beratuslu
beratuslu

Reputation: 1119

Cannot find entry file index.js

I tried to add push notifications to my app with https://github.com/evollu/react-native-fcm module. I end up with lots of errors and run many react commands on node including uprade commands. Now on simulator red screen says "Can not find entry file index.js in any of to roots" and when I look at the ReactPackager it says:

Loading dependency graph, done. Bundlingindex.js[development, non-minified] 0.0% (0/1), failed. error: bundling failed: Error at DependencyGraph._getAbsolutePath (/Users/beratuslu/Desktop/react-native-starter-app/node_modules/metro-bundler/src/node-haste/DependencyGraph.js:305:11) at DependencyGraph.getDependencies (/Users/beratuslu/Desktop/react-native-starter-app/node_modules/metro-bundler/src/node-haste/DependencyGraph.js:283:4236) at Resolver.getDependencies (/Users/beratuslu/Desktop/react-native-starter-app/node_modules/metro-bundler/src/Resolver/index.js:129:5) at /Users/beratuslu/Desktop/react-native-starter-app/node_modules/metro-bundler/src/Bundler/index.js:642:39 at Generator.next (<anonymous>) at step (/Users/beratuslu/Desktop/react-native-starter-app/node_modules/metro-bundler/src/Bundler/index.js:13:1336) at /Users/beratuslu/Desktop/react-native-starter-app/node_modules/metro-bundler/src/Bundler/index.js:13:1496 at process._tickCallback (internal/process/next_tick.js:103:7)

enter image description here

Here is my package.json: https://pastebin.com/2CsXCyJt

Any help appreciated...

Upvotes: 8

Views: 9074

Answers (2)

Rajesh Bhartia
Rajesh Bhartia

Reputation: 758

You can just try the following steps

  1. (in project directory) mkdir android/app/src/main/assets
  2. react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res
  3. react-native run-android

Upvotes: 0

Subramanya Chakravarthy
Subramanya Chakravarthy

Reputation: 1135

From react native 0.49.1 there is a breaking change, Merge your index.android.js and index.ios.js into index.js. For more details see this issue in Github

Upvotes: 10

Related Questions