Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

react-native metro bundle stuck and not running progress bar

Tags:

react-native

I work on react-native project on IOS & ANDROID.

On IOS the metro bundler console stuck at

Metro Bundler ready.
Loading dependency graph, done.

Nothing happen even after long delay. It should do the following :

Metro Bundler ready.
Loading dependency graph, done.
BUNDLE  [android, dev] ./index.android.js ░░░░░░░░░░░░░░░░ 0.0%       (0/1)Launching Dev Tools...
BUNDLE  [android, dev] ./index.android.js ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ 100.0% (982/982), done.
BUNDLE  [android, dev] ./index.android.js ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓ 100.0% (1/1), done.

Any idea please ?

I try to remove node_modules , clean project via Xcode , run "npm start"

like image 220
AlainIb Avatar asked Nov 08 '18 08:11

AlainIb


2 Answers

I have this sentence under scripts on my package.json. Try run it using npm run clear-all.

"clear-all": "watchman watch-del-all; rm -rf ./ios/build;  rm -rf ./ios/Pods; rm -rf $TMPDIR/react-*;rm -rf $TMPDIR/haste-*; rm -rf $TMPDIR/metro-*; rm -rf node_modules/; npm cache verify; npm install; npm start --reset-cache"

after that you have to run pod install and react-native run-ios again. Let me know if this works for you.

like image 184
Osiel Lima Avatar answered Nov 15 '22 06:11

Osiel Lima


i found a way to make it work. the project i work on was started a year and a half ago with xcode 9. xcode 10 change the way to process the compilation. you can configure it to use the xcode 9 legacy way ( i don't know the bad side of this )

 In Xcode -> file -> project setting 

 for  "pre user projects settings" choose "legacy build system"

enter image description here

EDIT : connecting the phone and computer to same wifi make it work too ( or create a hotspot with laptop)

like image 43
AlainIb Avatar answered Nov 15 '22 06:11

AlainIb