JS Bundle Error after upgrading to 0.70.1.
See original GitHub issueNew Version
0.70.1
Old Version
0.69.5
Build Target(s)
android debug and maybe release too
Output of react-native info
info Fetching system and libraries information...
System:
OS: Linux 5.19 Ubuntu 22.04.1 LTS 22.04.1 LTS (Jammy Jellyfish)
CPU: (4) x64 Intel(R) Core(TM) i7-2640M CPU @ 2.80GHz
Memory: 1.05 GB / 3.72 GB
Shell: 5.1.16 - /bin/bash
Binaries:
Node: 18.9.0 - /snap/bin/node
Yarn: 1.22.19 - /snap/bin/yarn
npm: 8.19.1 - /snap/bin/npm
Watchman: Not Found
SDKs:
Android SDK:
API Levels: 29, 30, 31, 32, 33
Build Tools: 29.0.2, 30.0.3, 31.0.0, 32.0.0, 33.0.0
Android NDK: Not Found
IDEs:
Android Studio: AI-212.5712.43.2112.8815526
Languages:
Java: 1.8.0_342 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 18.2.0 => 18.2.0
react-native: 0.70.1 => 0.70.1
npmGlobalPackages:
*react-native*: Not Found
Issue and Reproduction Steps
My issue is no library has been detected after the upgrade, for example:
error: Error: Unable to resolve module react-native-onesignal from /home/section/Documents/GitHub/MoonMeet-CrossPlatform/index.js: react-native-onesignal could not be found within the project or in these directories:
node_modules
../../../node_modules
7 | */
8 | import {AppRegistry} from 'react-native';
> 9 | import OneSignal from 'react-native-onesignal';
| ^
10 | import App from './App';
11 | import {name as MoonMeet} from './app.json';
12 | import {ONESIGNAL_APP_ID} from './src/secrets/sensitive';
at ModuleResolver.resolveDependency (/home/section/Documents/GitHub/MoonMeet-CrossPlatform/node_modules/metro/src/node-haste/DependencyGraph/ModuleResolution.js:178:15)
at DependencyGraph.resolveDependency (/home/section/Documents/GitHub/MoonMeet-CrossPlatform/node_modules/metro/src/node-haste/DependencyGraph.js:264:43)
at Object.resolve (/home/section/Documents/GitHub/MoonMeet-CrossPlatform/node_modules/metro/src/lib/transformHelpers.js:170:21)
at resolveDependencies (/home/section/Documents/GitHub/MoonMeet-CrossPlatform/node_modules/metro/src/DeltaBundler/graphOperations.js:466:33)
at processModule (/home/section/Documents/GitHub/MoonMeet-CrossPlatform/node_modules/metro/src/DeltaBundler/graphOperations.js:232:31)
at async traverseDependenciesForSingleFile (/home/section/Documents/GitHub/MoonMeet-CrossPlatform/node_modules/metro/src/DeltaBundler/graphOperations.js:221:3)
at async Promise.all (index 0)
at async initialTraverseDependencies (/home/section/Documents/GitHub/MoonMeet-CrossPlatform/node_modules/metro/src/DeltaBundler/graphOperations.js:204:3)
at async DeltaCalculator._getChangedDependencies (/home/section/Documents/GitHub/MoonMeet-CrossPlatform/node_modules/metro/src/DeltaBundler/DeltaCalculator.js:208:25)
at async DeltaCalculator.getDelta (/home/section/Documents/GitHub/MoonMeet-CrossPlatform/node_modules/metro/src/DeltaBundler/DeltaCalculator.js:90:16)
if I comment (//
) OneSignal and Notifee codes, I got ./app.json is not found 😕 which is 100000% inside my root project folder.
I’m pretty sure it’s a wrong node modules folder or something, when i rollback to 0.69.5 my application works fine
steps:
- followed
react-native community upgrade helper
instruction strictly two times. - did
yarn start --reset-cache
- did
cd android && ./gradlew clean && cd ..
- did
yarn android
- building looks fine without any errors
- after Gradle task
installDebug
- got those errors above
Issue Analytics
- State:
- Created a year ago
- Reactions:2
- Comments:16 (2 by maintainers)
Top Results From Across the Web
I have some problem when I upgrade my react-native version ...
I was clean my cache but It dont work!!! ERROR TypeError: undefined is not a function, js engine: hermes ERROR Invariant Violation: Failed...
Read more >Announcing React Native 0.70
We are excited to release a new version of React Native, 0.70.0. This version comes with several improvements like a new unified ...
Read more >Troubleshooting for React Native | Sentry Documentation
If you experience mismatched line numbers on sentry.io when using RAM Bundles, this is due to a bug on the Metro tooling. React...
Read more >main.jsbundle does not exist [fixed] | by Onexlab - Medium
No bundle URL present. Make sure you're running a packager server or have include a .jsbundle file in your application bundle. If you...
Read more >invariant violation viewproptypes has been removed - You.com
A frequent cause of the error is that the application entry file path is incorrect. This can also happen when the JS bundle...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
For me the problem was in
metro.config.js
. Lines 9-11 caused the problem.Adding
json
extension to the array solved the problem. I must admit that the error reporting for me was also confusing: I had the errors of resolving other modules rather than anything wrong withapp.json
.@SectionTN I see similar config in your repo, so I think you can try fixing your project by adding
json
to the array.so add
json
extension there