Solving React Native’s “No bundle url present” Error

I hit the “No bundle url present.” roadblock today and had to dig a bit to find the solution. I’m going to describe how I encountered the problem, and provide the solution that’s worked more than once for me, ever since I found the suggestion in the React Native GitHub repository.

The Problem

  • You’ve got a React Native app.
  • In the terminal, you run react-native run-ios.

In the simulator, you hit a roadblock with the following error in a bright red screen:

No bundle url present. Make sure you’re running a packager server or have included a .jsbundle file in your application bundle.

No bundle URL present

The Solution

Buried in the comments of one of the React Native repo’s issues on GitHub, I found a solution that worked for me…

  • Open a terminal window
  • cd into YOUR_PROJECT/ios
  • Remove the build folder with rm -r build
  • Run react-native run-ios again

Alternatively, you could open Finder, navigate to YOUR_PROJECT/ios and delete the build folder. Then run react-native run-ios again.

I’m not sure what causes this (that bothers me), but but at least I’ve found something to get me going again.

  • danconiaus

    You’re a lifesaver. Thanks a ton!

    • Very glad this helped – It seems odd that I have to do this process so often, but hey – at least it gets things running again!

  • fewspider

    thanks a lot, it is pretty odd, i donot know why react-native cannot handle this

  • Antwan Humphreys

    This seems to be the way with frontend development these days! Same with android in ionic i find….hit and miss if a build will succeed even with the same config on the same machine :p

  • It isn’t working for me, what can i do?

  • Thanks, it saves my day

  • meng yan

    Thank you. It works~

  • this does not work for me but problem was in changing jsCodeLocation for release,

    if you did this, then return back your jsLocation variable back to shared url one in AppDelegate.m

    // jsCodeLocation = [[NSBundle mainBundle] URLForResource:@”main” withExtension:@”jsbundle”];

    jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@”index.ios” fallbackResource:nil];