Zach
Zach

Reputation: 880

React Native "No bundle URL present" Release Mode Only

I'm getting "No bundle url present." only when trying to run in release mode in xcode. I can run the app fine in debug mode.

I ran react-native bundle --platform ios --dev false --entry-file index.ios.js --bundle-output ios/main.jsbundle and it gives me the following error:

Unexpected token: keyword (default)

It doesn't show any line numbers or files that the error might be from. Is there a better way to get more context around this error?

I also tried removing build folder, npm run clean, remove node_modules folder, yarn install with no luck.

This same exact build was working for me a few days ago, so not sure what changed. I'm still on the same version of MacOS, xcode, and react native.

RN = 0.43.3
Xcode = 8.3.2
MacOS = Sierra 10.12.5

Upvotes: 5

Views: 2748

Answers (3)

Bruno Cavallari Gois
Bruno Cavallari Gois

Reputation: 51

I had the same problem and solved by running the following command in the root directory of the project:

rm -rf ios/build/; kill $(lsof -t -i:8081); react-native run-ios

This command will remove the build folder from the iOS project, kill any other process running on port 8081, and re-run.

Upvotes: 1

Zach
Zach

Reputation: 880

I was able to solve this by upgrading watchman. Here are the steps I took:

  • brew update
  • brew unlink watchman
  • brew install watchman
  • I ran npm run clean which I have set to do this:

    rm -rf ios/build; rm -rf ios/build; rm -rf android/build; rm -rf android/app/build; rm -rf $TMPDIR/react* ; rm -f ios/main.jsbundle; rm -rf node_modules; rm yarn.lock || true; npm cache clean; yarn cache clean
    
  • yarn install or npm install, if you aren't using yarn

Hopefully this helps others having the same issue.

Upvotes: 1

frmdstryr
frmdstryr

Reputation: 21362

Removed node_modules and did npm install again and the error went away. Seems like someone had a typo...

Upvotes: 0

Related Questions