react-native: `npm starts` hangs on 'Loading dependency graph, done.'

Is this a bug report?

Yes

Have you read the Contributing Guidelines?

Yes

Environment

Environment: OS: macOS Sierra 10.12.6 Node: 8.9.1 Yarn: Not Found npm: 5.5.1 Watchman: 4.9.0 Xcode: Xcode 9.1 Build version 9B55 Android Studio: 2.3 AI-162.3871768

Packages: (wanted => installed) react: 16.0.0 => 16.0.0 react-native: 0.50.3 => 0.50.3

Steps to Reproduce

(Write your steps here:)

  1. react-native init MyApp
  2. cd MyApp
  3. npm start

Expected Behavior

  1. The browser opens with my app

Actual Behavior

  1. Nothing happens

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 40
  • Comments: 57 (2 by maintainers)

Most upvoted comments

in terminal in root of the project: react-native upgrade - it generates ‘IOS’ and ‘Android’ folders again react-native link react-native run-ios

solved this by not bothering with npm start but using yarn start instead

Make sure in Wifi is Turned on in Android & iOS emulator

actually realize its NOT hanging, its running, you just need to run the simulator also in the root level lololol

try to disable remote JS Debugging it works for me 😕 it seems it has already running but the simulator doesn’t respond

I have same issue: OS :Ubuntu 16.04 LTS Memmory:7.3GiB OS type:64-bit i also installed java,node with npm, then-- install: sudo npm install -g react-native-cli react-native init Sample react-native run-android react-native start after these code showing

“Looking for JS files in /mnt/20C8E761C8E73426/React native/Sample Metro Bundler ready. Loading dependency graph, done.” not working…

Make sure localhost is included as an exception in NSAppTransportSecurity in Info.plist file of the iOS project.

        <key>NSAppTransportSecurity</key>
	<dict>
		<key>NSExceptionDomains</key>
		<dict>
			<key>localhost</key>
			<dict>
				<key>NSExceptionAllowsInsecureHTTPLoads</key>
				<true/>
			</dict>
		</dict>
	</dict>

why for 30 days no one care lol, btw I am using create-react-native-app

I deleted node_modules, ran npm i again, then react-native run-ios and it worked fine.

I’ve been having this problem and I simply don’t understand what I need to do. Tried a bunch of things listed above but nothing works. What is the definitive process here?

@adamchenwei What exactly to do ? Can you elaborate. I am new to React Native.

Was facing the same issue, just run watchman watch . and then react-native start

it worked for me 😃

Same issue here too.

Tried removing/reinstalling watchman, the watchmen watch-del-all, removing node_modules and npm i again, rebooting macos. It started failing when I tried installing a dependency (npm), I removed/reverted that code but I can never run my app any more…

Everyone has different solutions to the issue, but none worked for me

@goodok21 something similar to react-native run-ios --simulator="iPhone 4s"

Leaving this here for future self if working on a react app with windows subsystem for linux (wsl).

So you can’t run react-native start-android because the deploying of the android app will fail (java path is wrong and a whole host of other things)

BUT YOU CAN

Build the app with android studio deploy it to your emulator or phone then

run react-native start

The Loading dependency graph, done

Message means … THE SERVER IS RUNNING!

Everything is good you just need to make sure adb is running in windows and

adb reverse tcp:<PORT> tcp:<PORT>

Then you can run your app.

(Also if you get a blank white screen in the app on your phone just kill the app and do the shake to reload thing. You’ll know its working when the app finally makes a request to the react-native server on your laptop)

But here is my ask to the react native team.

Can ya pls have a better server is ready message lol?

P.S one more note. react-native seems to require watchman to run. otherwise react-native start will get stuck at

Loading dependency graph

minus the , done part (see why I’m pleading for a better server has started message? )

the only way I could consistently get that working on wsl is

watchman -f --log-level=1 --logfile=/tmp/why-the-funk-isn-watchman-working.log

Because it often hangs and you need to know if it has done that. only way to tell is to try kill the watchman process and restart it…

if you can’t… you have to restart your computer! YAY ( there is some weird file system watcher bug the wsl guys haven’t nailed down yet)

but these incantations work if you try them hard enough

I also had the same problem. After ejecting a project on React Native, I typed “npm start” and it said “loading dependency graph, done” and stayed like that. But after typing “npm run ios” instead of “npm start” my problem was solved. iOS simulator and metro bundler run successfully.

Same thing here. Funny thing is my project was working just fine. haven’y updated it couple of months, and now it doesn’t work at all.

Edit: Reinstalling watchman solved the issue for me.