Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

main.jsbundle not found for ios #87

Open
Sachanski opened this issue Jul 10, 2020 · 12 comments
Open

main.jsbundle not found for ios #87

Sachanski opened this issue Jul 10, 2020 · 12 comments

Comments

@Sachanski
Copy link

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

@EmpireJones
Copy link

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.

@Sachanski
Copy link
Author

Sachanski commented Jul 13, 2020

@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?

@lorenzoangelini
Copy link

@EmpireJones I have the same problem after upgrading to 0.63

@umang-simform
Copy link

I am also facing same issue.

@lorenzoangelini
Copy link

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

@Sachanski
Copy link
Author

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

@umang-simform
Copy link

umang-simform commented Jul 13, 2020

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

@EmpireJones
Copy link

@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 #87 (comment)

@EmpireJones
Copy link

Likely implied from the title, but I believe this is only occurring for me on iOS builds. Android builds seem to complete successfully.

@Theofilos-Chamalis
Copy link

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

@zzorba
Copy link

zzorba commented Jul 17, 2020

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.

@zzorba
Copy link

zzorba commented Jul 17, 2020

Found this thread on the main react-native project where people are discussing the same issue, and have several proposed solutions: facebook/react-native#29351

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

6 participants