Facing error in installing react-native app

I follow every step, and App successfully build and install
but when it run in emulator it was showing error
platform - windows

error- Error: Unable to resolve module ./checkPermissions.js from utils\shareHandler.ts
please help me how can I resolve them

Ah yes, was struggling with something similar the other day. Try this:

  • delete all *.map files in app-mobile
  • run npm clean-install from the root of the project
  • run npm clean-install from packages/app-mobile

thanks for helping roman, but it is not work, yea it reduces the build time of app.

I think there is problem in importing typescript files in java script file, because when I did little change in importing statement (like import from '/xyz.js' to '/xyz.ts') it resolve and then started showing same error with another typescript file.. so this way there are many files I can't change import statement for all...
still finding solution.

This should work without any changes to imports.

Can you double check the file it complains about does not exist utils/checkPermissions.js. If it doesn't run npm run tsc from packages/app-mobile and, provided it completes successfully, see if the file appears.

yes, file utils/checkPermissions.js available but it is not java script file it is available in typescript extension.

error is asking for checkPermissions.js but it is in checkPermissions.ts
so i have two options first - change the file extension and second changing the import statement
but after doing that same error occur with other file.

You need to run TypeScript compiler (npm run tsc) it should produce .js

2 Likes

Yesssssssssssssss!!!! :smiley: :smiley:
TypeScript compiler works, Joplin successfully run in my local system,
thank you for support , today I successfully run my first open source app

Just a side note, there's a BUILD.md file, but if you think there's something missing, we can add a section to the build_troubleshooting.md

1 Like

Doesn't running npm i also build the TypeScript files? or is it currently broken? Otherwise, as mentioned in BUILD.md, you can run npm run watch to rebuild the TypeScript files in real time.

I think it usually does, but I had cases where something went wrong, and I had to run tsc (or sometimes npm install from individual packages) manually.
Never tried to get to the bottom of this.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.