Prop-types could not be found within the project

I am getting below error when I start the App.

[Output] Error: Unable to resolve module prop-types from <PROJECT_ROOT>\node_modules\react-native-pdftron\index.js: prop-types could not be found within the project.

[Output] If you are sure the module exists, try these steps:
[Output] 1. Clear watchman watches: watchman watch-del-all
[Output] 2. Delete node_modules and run yarn install
[Output] 3. Reset Metro’s cache: yarn start --reset-cache
[Output] 4. Remove the cache: rm -rf /tmp/metro-*

Did you try steps 1-4 listed in the error?

If yes, and that did not help, then could you elaborate on what you mean exactly by “start the App”?

Yes I tried but it didn’t fix my Issue. I am developing a Mendix native app and below are the steps I followed

  1. Create Mendix Native App
  2. Create Native Widget
  3. As mentioned in GitHub - PDFTron/pdftron-react-native: A convenience wrapper for building react native apps with PDFTron mobile SDK. run below steps into widget project
    npm install github:PDFTron/pdftron-react-native --save
    npm install @react-native-community/cli --save-dev
    npm install @react-native-community/cli-platform-android --save-dev
    npm install @react-native-community/cli-platform-ios --save-dev
  4. Replace the Widget component.jsx code with App.js code given in above GitHub repo
  5. Run the app locally
  6. Try viewing the native app using Make it Native. It throws above error

I saw a sample code available for Mendix web integration(https://www.pdftron.com/documentation/web/mendix/). Do you have the similar code available for Native integration?

Mohan, we can put something together specifically for Mendix Native. What is your timeline?

Sure. I live in EST time zone and I am available to discuss anytime until 5p.m EST. Let me know your availability.

@mohan.kathireddy If you are using TypeScript, a better sample to look at is GitHub - PDFTron/react-native-sample: Sample to demonstrate integrating PDFTron in React Native, are you able to give that a try? Thanks.

I am getting below error when create widget using typescript. Earlier I tried by creating a widget using Javascript and got the error mentioned above.

Could not find a declaration file for module ‘react-native-pdftron’. ‘C:/workdir/Work/Mendix/PracticeApps/TestApp/CustomWidgets/testPDFTron/node_modules/react-native-pdftron/index.js’ implicitly has an ‘any’ type.
Try npm i --save-dev @types/react-native-pdftron if it exists or add a new declaration (.d.ts) file containing declare module 'react-native-pdftron';ts(7016)

It will be very helpful and saves lot of time if you guys can try creating a Mendix native widget using Build a Pluggable Native Widget - Studio Pro 9 How-to's | Mendix Documentation, integrate the PDFTron and share the steps with me.

@mohan.kathireddy I did try going through it. I got stuck on Step 4 “Building JavaScript bundle” here Build a Mendix Native Mobile App Locally - Studio Pro 9 How-to's | Mendix Documentation. with the following error: https://forum.mendixcloud.com/link/questions/105581. How are you building the JavaScript bundle in your environment? Are you able to build the bundle with the UI instead of the command line?

I am using Command Line to build. Are you using the correct Java to build?

Mendix uses Adopt Open JDK and is installed at following location C:\Program Files\AdoptOpenJDK\jdk-11.0.3.7-hotspot.

As mentioned in forum topic, Clean the deployment directory using following menu option App → Clean Deployment Directory and then App → Deploy for Eclipse and then run the command to build the bundle

@mohan.kathireddy thanks. Just an update for you, we are also experiencing issues and we are in contact with Mendix support. We will let you know if we hear anything from them. Thanks.

@Shirley_G , Are you able to fix above issue? Could you please brief little bit about issue you are facing if the issue is different.

Did you hear anything from Mendix support on this issue?

@mohan.kathireddy I’m stuck on the part that PDFTron needs to alter original Java/Obj-C code, but the studio only provide JS bundle. So it’s unsure how to create a module that alters Java/Obj-C code.

Mendix support said they are looking into it and will reply as soon as they can.

@Shirley_G , thanks for the update. This has become critical for me now, Is there a way that you can follow up and get a quick solution and let me know whether its possible to integrate PDFTron React Native with Mendix Native or not?

@mohan.kathireddy could you send me what you have so far? At the moment I’m not even sure if I’m on the right track as I’m new to Mendix. I did follow up with Mendix again to see if they can give a response. Thanks.

We can have a call if you are available today. I am in EST time zone.