Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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
like image 904
Zach Avatar asked Oct 29 '22 07:10

Zach


2 Answers

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.

like image 172
Zach Avatar answered Nov 15 '22 07:11

Zach


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.

like image 27
Bruno Cavallari Gois Avatar answered Nov 15 '22 05:11

Bruno Cavallari Gois