当我运行一个react-native项目时,我得到一个错误,没有bundle URL,但我不知道我做了什么错误,我很困惑。


当前回答

关闭模拟器和终端。打开一个新的并进入你的项目,然后像这样升级你的react-native:

react-native upgrade

问题:当bundle执行失败时,RCTFatal中的无限递归。

其他回答

这是react-native v0.42.1的一个问题。尝试关闭所有终端和XCode实例并运行:

launchctl unload ~/Library/LaunchAgents/com.github.facebook.watchman.plist
watchman version
react-native run-ios

export FORCE_BUNDLING=true为我工作。在控制台中有一个警告,它没有被捆绑。

我在我的macbook上通过电缆和wifi连接到网络,关闭wifi,点击运行,它就工作了!

如果您正在运行IOS模拟器,请确保需要运行此命令

react-native运行android 或 npm运行android

一旦你运行以上命令metro bundler将启动,然后运行react- negative run-ios它将工作。

对于我的用例,我必须删除node_modules目录并运行npm install。

$ rm -rf node_modules   (make sure you're in the ios project directory)
$ npm install

如果你得到错误“dyld: Library not loaded: /usr/local/opt/icu4c/lib/libicui18n.58。Dylib”,执行以下操作:

$ brew uninstall --force node --ignore-dependencies node
$ brew uninstall icu4c --ignore-dependencies icu4c
$ brew install icu4c
$ brew unlink icu4c && brew link icu4c --force
$ brew install node

$ npm install