React Native"No bundle URL present"仅限发布模式

Zac*_*ach 5 ios react-native

我得到"没有捆绑网址." 仅当尝试在xcode中以释放模式运行时.我可以在调试模式下运行应用程序.

我跑了react-native bundle --platform ios --dev false --entry-file index.ios.js --bundle-output ios/main.jsbundle,它给了我以下错误:

Unexpected token: keyword (default)
Run Code Online (Sandbox Code Playgroud)

它不显示错误可能来自的任何行号或文件.有没有更好的方法来获得更多关于此错误的上下文?

我也尝试删除构建文件夹,npm运行清理,删除node_modules文件夹,纱线安装没有运气.

几天前,这个相同的构建对我有用,所以不确定发生了什么变化.我仍然使用相同版本的MacOS,xcode,并做出本机反应.

RN = 0.43.3
Xcode = 8.3.2
MacOS = Sierra 10.12.5
Run Code Online (Sandbox Code Playgroud)

Zac*_*ach 1

我可以通过升级守望者来解决这个问题。以下是我采取的步骤:

  • brew update
  • brew unlink watchman
  • brew install watchman
  • 我跑了npm run clean,我已经设置这样做:

    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
    
    Run Code Online (Sandbox Code Playgroud)
  • yarn install或者npm install,如果您不使用纱线

希望这可以帮助其他遇到同样问题的人。