简体   繁体   中英

React Native - Failed to load bundle in iOS

打开应用程序时出现错误屏幕

I am native iOS app developer but i also want to be aware of latest and trending technology so i choose to get my hands on react native. Now, i am getting this error when trying to run my react native created app on iOS. I enter the command react-native run-ios and simulator started and after that app opened but in starting it showed this screen.

There are couple of solutions available in the link below. Please try them.

https://github.com/facebook/react-native/issues/21310

for now after react-native init, since a lot of new changes are coming out, this fix worked for me (I got it from reading other issues):
with npm:
npm install --save-dev @babel/core
npm install --save-dev @babel/runtime
or with yarn:
yarn add --dev @babel/core
yarn add --dev @babel/runtime

if on ios you get _this._registerEvents is not a function, after a successful build
do
npm run start --reset-cache
or
react-native start --reset-cache

For me i got reason for issues that for now since a lot of new changes are coming out like Xcode 10 itself is new and react native is not yet merged with that, this fix worked for me:

with npm:

npm install --save @babel/runtime

or with yarn:

yarn add @babel/runtime

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM