React-native: [0.45.0] new app setup fails "bundling: Error at DependencyGraph._getAbsolutePath"

Created on 7 Jun 2017  ·  20Comments  ·  Source: facebook/react-native

react-native init testApp
cd testApp
react-native run-ios

yields:

error: bundling: Error at DependencyGraph._getAbsolutePath (/Users/nilspoltoraczyk/Desktop/temp/testApp/node_modules/react-native/packager/src/node-haste/DependencyGraph.js:280:11) at DependencyGraph.getDependencies (/Users/nilspoltoraczyk/Desktop/temp/testApp/node_modules/react-native/packager/src/node-haste/DependencyGraph.js:218:26) at Resolver.getDependencies (/Users/nilspoltoraczyk/Desktop/temp/testApp/node_modules/react-native/packager/src/Resolver/index.js:107:27) at /Users/nilspoltoraczyk/Desktop/temp/testApp/node_modules/react-native/packager/src/Bundler/index.js:591:37 at Generator.next (<anonymous>) at step (/Users/nilspoltoraczyk/Desktop/temp/testApp/node_modules/react-native/packager/src/Bundler/index.js:12:445) at /Users/nilspoltoraczyk/Desktop/temp/testApp/node_modules/react-native/packager/src/Bundler/index.js:12:605 at <anonymous> at process._tickCallback (internal/process/next_tick.js:169:7) Bundling index.ios.js 0.0% (0/1), failed.

OSX 10.11.6

Locked

Most helpful comment

I got it to work by starting the packager with npm run start -- --reset-cache.

But you have to reset the cache each time you close it.

All 20 comments

I got it to work by starting the packager with npm run start -- --reset-cache.

But you have to reset the cache each time you close it.

Getting the same error here after the last Xcode update.

Also getting the same error with Android.

react-native init Project
cd Project
react-native run-android

Android: 7.0 and 6.0 (real devices)
Mac: OSX 10.12.5
"react": "16.0.0-alpha.12",
"react-native": "0.45.0"

Getting the same error for run-ios and run-android.
Looking for JS files in /node_modules/react-native/packager
instead of

npm start works ok

Getting this error. Trying to look files from '/node_modules/react-native/packager'

react-native 0.45
Xcode 9

I am seeing the same problem after upgrading to react-native 0.45. But my error message is slightly different:
NotFoundError: Cannot find entry file build/app/app.ios.js in any of the roots: ["<omitted>/client/node_modules/react-native"]

That might be the reason why @aparedes's npm run start -- --reset-cache didn't work for me. Using --root as suggested here did work, though:

npm run start -- --root <directory_with_your_react_component_js_sources>

I'm having this issue as well. @aparedes's advice is getting me by for now, but it's annoying having to run that command every time I want to launch my app.

macOS: 10.12.5 (16F73)

Same problem as @br4nnigan but with Android, @aparedes's solution seems to be working.

Windows 10
react-native 0.45.0
react 16.0.0-alpha.12
Android

I ended up using rninit to initialize the project with the previous release.

I met a problem, also hope to get some help, thank you very much:
Error message:
<
Loading dependency graph, done.
error: bundling: Error
at DependencyGraph._getAbsolutePath (/Users/xinghao/Desktop/RNNewsCar/node_modules/react-native/packager/src/node-haste/DependencyGraph.js:280:11)
at DependencyGraph.getDependencies (/Users/xinghao/Desktop/RNNewsCar/node_modules/react-native/packager/src/node-haste/DependencyGraph.js:218:26)
at Resolver.getDependencies (/Users/xinghao/Desktop/RNNewsCar/node_modules/react-native/packager/src/Resolver/index.js:107:27)
at /Users/xinghao/Desktop/RNNewsCar/node_modules/react-native/packager/src/Bundler/index.js:591:37
at Generator.next ()
at step (/Users/xinghao/Desktop/RNNewsCar/node_modules/react-native/packager/src/Bundler/index.js:12:445)
at /Users/xinghao/Desktop/RNNewsCar/node_modules/react-native/packager/src/Bundler/index.js:12:605
at
at process._tickCallback (internal/process/next_tick.js:169:7)
Bundling index.ios.js 0.0% (0/1), failed.
error: bundling: Error
at DependencyGraph._getAbsolutePath (/Users/xinghao/Desktop/RNNewsCar/node_modules/react-native/packager/src/node-haste/DependencyGraph.js:280:11)
at DependencyGraph.getDependencies (/Users/xinghao/Desktop/RNNewsCar/node_modules/react-native/packager/src/node-haste/DependencyGraph.js:218:26)
at Resolver.getDependencies (/Users/xinghao/Desktop/RNNewsCar/node_modules/react-native/packager/src/Resolver/index.js:107:27)
at /Users/xinghao/Desktop/RNNewsCar/node_modules/react-native/packager/src/Bundler/index.js:591:37
at Generator.next ()
at step (/Users/xinghao/Desktop/RNNewsCar/node_modules/react-native/packager/src/Bundler/index.js:12:445)
at /Users/xinghao/Desktop/RNNewsCar/node_modules/react-native/packager/src/Bundler/index.js:12:605
at
at process._tickCallback (internal/process/next_tick.js:169:7)
Bundling index.ios.js 0.0% (0/1), failed.

>
I don't know how this is a mistake
I NPM is 5.0
node is 8.0
10.12.5 is OS
Hope to get answer Thank you very much

I'm having the same problems after upgrade from react native 0.36.0 to 0.45.0 and running npm run start -- --root starts from console starts the app. Running latest xcode update

I am also facing similar error.

​186590d22c93:kasave ashiqm$ react-native -v
react-native-cli: 2.0.1
react-native: 0.45.0
186590d22c93:kasave ashiqm$ node -v
v8.1.0
186590d22c93:kasave ashiqm$ npm -v
5.0.3

Loading dependency graph, done.
error: bundling: Error
    at DependencyGraph._getAbsolutePath (/Users/ashiqm/Ashiq/Learning/React-native/kasave/node_modules/react-native/packager/src/node-haste/DependencyGraph.js:280:11)
    at DependencyGraph.getDependencies (/Users/ashiqm/Ashiq/Learning/React-native/kasave/node_modules/react-native/packager/src/node-haste/DependencyGraph.js:218:26)
    at Resolver.getDependencies (/Users/ashiqm/Ashiq/Learning/React-native/kasave/node_modules/react-native/packager/src/Resolver/index.js:107:27)
    at /Users/ashiqm/Ashiq/Learning/React-native/kasave/node_modules/react-native/packager/src/Bundler/index.js:591:37
    at Generator.next (<anonymous>)
    at step (/Users/ashiqm/Ashiq/Learning/React-native/kasave/node_modules/react-native/packager/src/Bundler/index.js:12:445)
    at /Users/ashiqm/Ashiq/Learning/React-native/kasave/node_modules/react-native/packager/src/Bundler/index.js:12:605
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:169:7)
Bundling `index.android.js`  0.0(0/1), failed.

Me too

+1

Doesn't anyone test these releases?

Issue resolved for me.

The react-native launched new release 0.45 a few days back. So, the commands to create a react-native application and running locally have many differences.

npm install -g create-react-native-app
Then run the following commands to create a new React Native project called "AwesomeProject":

the new way of creating a react-native application as follows
create-react-native-app AwesomeProject

cd AwesomeProject
npm start

Please follow the official documentation for creating an application and running the application on locally. hope the below link will help you.
https://facebook.github.io/react-native/docs/getting-started.html

Once you've set these up, you can launch your app on an Android Virtual Device by running npm run android, or on the iOS Simulator by running npm run ios(macOS only).

Enjoy, Happy coding :)

Applications created using create-react-native-app are set up in a different manner. Projects created using react-native init, e.g. "Projects Built with Native Code", are still supported and should work. The workaround is not to switch to CRNA, but rather to kill and restart the packager directly using npm start. At this point you can reconnect your app to the packager by reloading.

Closing as duplicate of #14246.

+1 - this happens on an upgraded application as well.

Brothers, ladies I found the solution:0.45.0 seems to be a beta and formal version of the mixtureWhen we are creating a new project to knock this command react - native init XXX - versoin 0.44.3Then you can I've tried no problem is not in use 0.45.0 version created

Init react native for any version.
react-native init ProjectName --version 0.42.0

Was this page helpful?
0 / 5 - 0 ratings