-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
Cannot find entry file index.ios.js [index.android.js] in any of the roots #14246
Comments
Run the packager first with |
@willdawsonme this does fix it, is there a way to make the fix more permanent (Normally, when I ran New terminal, doesn't work:
Now when I run
|
You should only need to run this once after an upgrade. The 'run-android' step essentially runs npm start if there are no packagers already running, so there's no harm starting them separately once. You might be able to pass a reset cache flag to run-android, but I've not tried it.
… On 30 May 2017, at 12:38 pm, MyTotoro ***@***.***> wrote:
@willdawsonme this does fix it, is there a way to make the fix more permanent (Normally, when I ran `react-native run-android, a new terminal window would pop up)
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
I encounter the exact same issue now with 0.45.0-rc.2 in a fresh react-native init project. |
Same here .. upgraded to 0.45 and facing this issue of having to do --reset-cache everytime before doing react-native run-ios or android . |
It seems to be a common issue, I had this issue too with 0.45-rc2 |
Having same issue after upgrading. |
Also seeing this. Notice that after
After
Clearly the first time around the bundle location is set incorrectly. |
Same here, steps to reproduce and temp fix: $ react-native init testapp
# testapp created
$ cd testapp
$ react-native -v
react-native-cli: 2.0.1
react-native: 0.45.0
$ react-native run-ios
# On simulator, I'm getting:
# Cannot find entry file index.ios.js in any of the root ["../testapp/node_modules/react-native/packager"] Temporary fix:
$ npm start -- --reset-cache
Loading dependency graph, done.
Note: I have to do the temporary fix every single time. |
Yup this is a legit defect, I also ran into it. I haven't been paying as much attention to the packager updates as of late but I think it was introduced in the latest v0.45 release. Not seeing it in v0.44. Possibly in this commit? a26e042 Basically when the packager is started automatically it doesn't have the correct root directory to traverse from. cc/ @davidaurelio |
I got the same trouble, any permanent fix? |
I have the same problem here. Currently affecting me when starting on a new project.
I guess I'll upgrade react native version in my project when this is fixed upstream. Edit: Ok, I feel dumb now. react-native-cli already does this. Forget what I wrote above. |
Ran into same problem and temporary fix works in my case. |
Still the same on 0.46.0-rc.0 (released a few hours ago) |
Having the same issue. Running packager with react-native-cli: 2.0.1 |
Summary: Splits `ConfigT` into `ConfigT` (core + packager configuration) and `RNConfig` (RN CLI configuration). Also guarantees that all values on `ConfigT` have a default when loading user configuration. Reviewed By: jeanlauliac Differential Revision: D4985965 fbshipit-source-id: bf036e22d6809e49746a9c3aa240ec403a085342
I'm consolidating various related issues into this one. As far as I can tell, #14314, #14366, #14376, and #14386 are all duplicates. DescriptionReact Native projects built with native code targeting
User reports claim the same issue affects Android, which may result in an error like so (included here for discoverability/search):
The packager displays the following error when the RedBox is displayed:
Reproduction Steps and Sample CodeThis can be reproduced on a clean, new project. First, create a new project using the CLI, then start the packager and launch the app:
At this point, the iOS Simulator will launch and display a RedBox with the error SolutionThe user may work around this issue by killing the packager that is launched by Additional Information
|
Great stuff @hramos . Do you have any idea why running 'npm start' after re-creating the issue works? I ran into the same issue (entry file index.ios.js not found) after several days hiccup free. However, today I did some Django work in a Python3 virtualenv. When I came back to ReactNative I ran into the same issue you detailed above.
|
#14412 should fix this in master. We'll need to cut a new 0.45 release. |
@hramos - Awesome, when is this going to be available? |
@udarts Did you try my solution? |
I had the same problem after upgrading from 46.x to 49.x even after creating a new index.js and change the AppDelegate.m and MainApplication.java
Solution was |
guys I tried npm start and npm run start --reset-cache but even I get bundler ready written in terminal after writing react-native run-ios my terminal completely freezes :/ |
I have tried all the above steps still i am facing this issue |
i am getting error "Cannot find entry file 'index.js' in any of the roots:" while creating main.jsbundle |
I have only index.js file |
I'm facing this issue running react-native 0.47.1. The path given in the [] is the root of the react native project I'm running the packager inside. |
Faced (and managed to troubleshoot) this with react-native 0.51.0 and TypeScript. In my case, the root cause was an improperly implemented watch script that was removing all the .js files and doing a full recompile. As long as the full recompile was happening in parallel with metro bundler collating its dependency tree, it led to the error. Doing the recompile before executing |
installed react-native-cli and this command worked for me |
Hi everyone! Maybe I can help you
|
#truongtq2506,
The fix to this issue is not to recreate the index.android.js and index.ios.js, we just got rid of the double index files. I had the same issue and fixed it by making a copy of my existing files and then remove all and create a new react native project, then past my code into the new project. Since that time my app is running without issues. Cheers |
After I upgraded my test program, I had the same issue. But I fixed it by adding the 'root' attribute, to the configuration file 'build.gradle' of module 'app'. The root directory can't be absolute path. project.ext.react = [ |
Dear Ms/Mr Waoywssy*,*
I so happy when you ask me about question. But I can't help you because
this problem not clear.
I'm so sorry.!
Thanks and best regard!
Mr Truong
Truong Tran Quang
---------------------------------------------------------------------
*Software Developer*
Email: [email protected]
Mobile: +84 121 218 4802 <%2B81-90-8732-0462>
skypeID: truong.tq2
---------------------------------------------------------------------
…On 27 December 2017 at 09:53, waoywssy ***@***.***> wrote:
After I upgraded my test program, I had the same issue. But I fixed it by
adding the 'root' attribute, to the configuration file 'build.gradle' of
module 'app'. The root directory can't be absolute path.
project.ext.react = [
entryFile: "index.android.js",
// the root of your project, i.e. where "package.json" lives
*root: "../../",*
]
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#14246 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AOYKVuFgnDk5DGXUbopgIYEH_39-yo4Yks5tEbEjgaJpZM4NplvW>
.
|
This issue is still in version 0.52.2. Any permanent solution? It is very sad that someone can run blank RN project. |
Still in version 0.53.0. |
Hey there. If you created your app with CRNA (create-react-native-app), make sure you have ejected your app first. More info can be found from here: https://github.com/react-community/create-react-native-app/blob/master/EJECTING.md |
Still an issue with
Any help is welcome |
@vitorll - Try this. The issue has inconsistently happened for my colleagues, who all followed my instructions for setting up an RN dev env, but not for me. What would happen for them is their initial build would work, particularly if iOS or Android native files were being built from scratch but the subsequent builds would result in the dreaded error from the bundler:
Today we noticed that 'which watchman' returns nothing for them but returned an instance of watchman for me. When I setup my dev env a year ago I installed watchman but did not include it in my instructions for the setup of their dev environments. Installing watchman (and ensuring it is in the path) took care of this for them. On Mac you can install via 'brew install watchman' if using HomeBrew. Could you please try this and confirm here if this resolves your issue? |
I have the similar issue on android. To solve it I juste create manualy the index.android.js ( here for you index.ios.js ). And add this into it : AppRegistry.registerComponent('LtcNice', () => App);` After that I run manualy react-native start and react-native run-android and it's works. I hope it's gonna to be the same for you. |
If you are updating from an old project you need to make sure the correct files are loaded from native code to adopt the new single file entry point. // android/app/src/main/java/<yourPackage>/MainApplication.java
private final ReactNativeHost mReactNativeHost = new ReactNativeHost(this) {
//...
@Override
protected String getJSMainModuleName() {
return "index";
}
}; // ios/<project>/AppDelegate.m
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
NSURL *jsCodeLocation;
jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
//...
} |
I've also started getting:
after upgrading to To fix this, I had to remove my Hope this helps someone else looking for the fix. |
[edit #2: this is now fixed as of 0.45.1 and 0.46.0-rc.2 - @hramos]
[edit: scroll down for additional details - @hramos]
Description
Recently upgrade to RN 0.45 from 0.42 (I was hit with #14225 and I figured I might as well spend the time migrating)
Error in Bundler:
and red screen showing
Response error 404, Cannot find entry file index.android.js in any of the roots: [\"/Users/mytotoro/desktop/app/node_modules/react-native/packager\"]
With NotFoundError
Reproduction Steps and Sample Code
I run
react-native run-android
from the root directory of my project as I have always been doing:This issue comes up for iOS as well (I run on device through xcode) but the offending file is index.ios.js
[edit: adding duplicates -@hramos]
Duplicates
react-native run-ios
#14376The text was updated successfully, but these errors were encountered: