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

[0.45.0] Project roots are incorrect if packager starts when invoking react-native run-ios #14376

Closed
ds300 opened this issue Jun 7, 2017 · 26 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@ds300
Copy link

ds300 commented Jun 7, 2017

Steps for reproduction

First make sure you have no react-native packager instance running

react-native init Bananas
cd Bananas
react-native run-ios

Effect

I get the error

Cannot find entry file index.ios.js in any of the roots: ["/Users/dshe/code/Bananas/node_modules/react-native/packager"]

image

Workaround

Start the packager from yarn start

@OmgDef
Copy link

OmgDef commented Jun 7, 2017

+1

@dcp12345678
Copy link

I got this when doing react-native run-android as well (this is with a brand new project created with react-native init TestProject3), so I don't think the problem is limited to ios.

image

@ccdwyer
Copy link

ccdwyer commented Jun 7, 2017

Looks like a duplicate of #14366.

@ds300
Copy link
Author

ds300 commented Jun 7, 2017

#14366 has the same reproduction steps and might be related, but is a different error. Note that it seems to persist even if you run the packager with yarn start or similar without clearing the cache.

@kostap13
Copy link

kostap13 commented Jun 7, 2017

run-ios and run-android not working.
npm start working.

React packager ready.

Loading dependency graph, done.
error: bundling: NotFoundError: Cannot find entry file index.android.js in any of the roots: ["[path to project]/node_modules/react-native/packager"]

@kostap13
Copy link

kostap13 commented Jun 8, 2017

Maybe this commit broke build
236e9e4

@ccdwyer
Copy link

ccdwyer commented Jun 8, 2017

@ds300 Check out your console when you get this error. At least for me, these errors seem to go hand in hand.
screen shot 2017-06-07 at 9 30 04 pm

@dmr07
Copy link

dmr07 commented Jun 8, 2017

@ds300 what version of React do you have in your node_modules? Make sure it's 16.0.0-alpha12+. I had the same issue and it was because npm was giving me 15.4.4

@anhtuank7c
Copy link

I have same problem.
RN: 0.45.0
React: 16.0.0-alpha12

screen shot 2017-06-08 at 10 26 42 am

@zachlucas
Copy link

+1

@VitorBe
Copy link

VitorBe commented Jun 8, 2017

I have the same issue with run-android.
Yesterday everything worked fine.
Didn't upgrade anything manually.

@VitorBe
Copy link

VitorBe commented Jun 8, 2017

@dmr07 How can i check version of React in node_modules? How can i upgrade this? Sorry, i'm newbie.

@VitorBe
Copy link

VitorBe commented Jun 8, 2017

that's how i've solved the issue in my Windows PC:

  1. in the first admin's cmd.exe typed: 'netstat -a -b -o'.
    Found PID of 8081 server.
    Then i killed this proccess by typing 'taskkill /pid 1234' where '1234' - your PID.
  2. open normal cmd.exe and typed: 'react-native start'.
  3. open another normal cmd.exe and typed: 'react-native run-android'.

@ethanyanjiali
Copy link

ethanyanjiali commented Jun 8, 2017

I posted a solution in a different thread.
copy paster here to help more people:

I just deleted the app on my simulator and ran react-native run-ios again. it's now working. I've also cleaned all the cache:
watchman watch-del-all
rm -rf node_modules && npm install
npm start -- --reset-cache
not sure if it's related

@kostap13
Copy link

kostap13 commented Jun 8, 2017

@dmr07 Version in packackage.json and node_modules is "react": "16.0.0-alpha.12"

lsof -n -i4TCP:8081 - no processes

ps -ef | grep "npm" :
501 1603 1317 0 10:32 ttys001 0:00.00 grep npm

@kostap13
Copy link

kostap13 commented Jun 8, 2017

@ethanyanjiali
Is react-native run-android or react-native run-ios working now?

@ethanyanjiali
Copy link

haven't tried android. but react-native run-ios works for me after i cleaned up everything through the commands I listed above

@ds300
Copy link
Author

ds300 commented Jun 8, 2017

@ccdwyer in the packager output I see the same error message as I get in the red screen of death.

@dmr07 my react version is 16.0.0-alpha12

@ethanyanjiali That didn't work for me. Did you make sure the packager wasn't already running before trying react-native run-ios?

FWIW I think this is just an issue with how the packager gets invoked by the react-native cli if it is not already running. Haven't had time to debug it though, sorry.

@MSchmidt
Copy link

MSchmidt commented Jun 8, 2017

@ethanyanjiali this only works because you are starting the packager with npm start (regardless of --reset-cache). The issues people are having is related to the automatic packager start through react-native run-ios.

@anhtuank7c
Copy link

In my case:

Open terminal Tab 01: react-native start
Open terminal Tab 02: react-native run-ios

Should work :-p

@ethanyanjiali
Copy link

@MSchmidt @ds300
Like I said

but react-native run-ios works for me after i cleaned up everything through the commands I listed above

Let me rephrase the solution again:

  1. open you simulator, delete the app
  2. watchman watch-del-all
  3. rm -rf node_modules && npm install
  4. npm start -- --reset-cache
  5. STOP you packager that started by last command
  6. react-native run-ios

@ethanyanjiali
Copy link

I used this solution and succeed twice (one for upgrading from 0.44 to 0.45, one for downgrading from 0.46 to 0.45)

@kostap13
Copy link

kostap13 commented Jun 8, 2017

@anhtuank7c Thanks!
It works as @ethanyanjiali described without Step 5.

@dmr07
Copy link

dmr07 commented Jun 8, 2017

@kostap13 Hmm. Here is what I did to resolve the error:

  1. Do not close the terminal window of the server that threw the error.
  2. lsof -n -i4TCP:8081
  3. kill -9 (process id returned above)
  4. npm start

max2three referenced this issue Jun 8, 2017
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
@hramos
Copy link
Contributor

hramos commented Jun 8, 2017

@kostap13 236e9e4 is unrelated to this, as that commit is not in the 0.45 or 0.46 releases.

@hramos
Copy link
Contributor

hramos commented Jun 8, 2017

Closing as duplicate of #14246.

@hramos hramos closed this as completed Jun 8, 2017
@facebook facebook locked as resolved and limited conversation to collaborators Jun 8, 2018
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

14 participants