upgrade-support
upgrade-support copied to clipboard
main.jsbundle not found for ios
Environment
System: OS: macOS 10.15.5 CPU: (4) x64 Intel(R) Core(TM) i5-5257U CPU @ 2.70GHz Memory: 239.48 MB / 8.00 GB Shell: 3.2.57 - /bin/bash Binaries: Node: 12.18.2 - ~/.nvm/versions/node/v12.18.2/bin/node Yarn: 1.10.1 - /usr/local/bin/yarn npm: 6.14.5 - ~/.nvm/versions/node/v12.18.2/bin/npm Watchman: 4.9.0 - /usr/local/bin/watchman Managers: CocoaPods: 1.9.3 - /Users/ivo/.rbenv/shims/pod SDKs: iOS SDK: Platforms: iOS 13.5, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2 Android SDK: API Levels: 24, 27, 28, 29 Build Tools: 28.0.3, 29.0.2 Android NDK: 20.0.5594570 IDEs: Android Studio: 3.4 AI-183.6156.11.34.5692245 Xcode: 11.5/11E608c - /usr/bin/xcodebuild Languages: Java: 1.8.0_131 - /usr/bin/javac Python: 2.7.16 - /usr/bin/python npmPackages: @react-native-community/cli: Not Found react: 16.13.1 => 16.13.1 react-native: 0.63.0 => 0.63.0 npmGlobalPackages: react-native: Not Found
Upgrading version
0.63
Problem
Running xcode build result in main.jsbundle not found
Solution
I had imports like this:
import Component from '..'
replacing these imports with relative paths seems to have resolved the issue. Here is my SO answer to a question regarding main.jsbundle for 0.63
This seems to be related to usage of babel-plugin-module-resolver in my case. Were you using that too?
I haven't figured out a workaround yet. Removing usage of that plugin isn't really a great solution.
@EmpireJones I can confirm that I am also using babel-plugin-module-resolver (^3.2.0).
Is the issue surfacing with some ..
imports or similar?
@EmpireJones I have the same problem after upgrading to 0.63
I am also facing same issue.
in my case path like this: import { SplashScreen } from 'src/splashScreen/screen'. They are searched inside the node_module, and obviously they are not found. In the previous version of react native i don't have this problem
If that helps anyone - I have the following section in my .babelrc
:
{
...,
"plugins": [
...,
["module-resolver", {
"root": "./",
"alias": {
"src": "./src",
"@components": "...",
}
}]
]
}
and the same for every direct child of the src folder
I am getting this error in particular:
Showing Recent Errors Only
error index.js: Import statement may only appear at top level in file index.js at 4:2. Run CLI with --verbose flag for more details.
Error: Import statement may only appear at top level in file index.js at 4:2
@Sachanski In my project I'm just using the plugin to set the root; I'm not using aliases or ".." in these imports. Usage is similar to @lorenzoangelini's https://github.com/react-native-community/upgrade-support/issues/87#issuecomment-657451645
Likely implied from the title, but I believe this is only occurring for me on iOS builds. Android builds seem to complete successfully.
I am greeted with the same "main.jsbundle not found" error, however this happens only when I am trying to run the application on a physical iPhone device. On the Simulator it is running with no issues
Seeing the same issue -- have tried a few alternate configs for the module-resolver with no luck, no change when upgrading to 0.63.1 either.
Only seems to happen when generating the bundle, the simulator/debug mode works just fine.
Found this thread on the main react-native project where people are discussing the same issue, and have several proposed solutions: https://github.com/facebook/react-native/issues/29351