8

I am getting this while running app on simulator using xCode, version 9.2 enter image description here

I've tried other solution mentioned on Stack overflow & Github S1S2 S3 S4 but most of the solution are mentioned for android.

P.S. This project also includes purescript code explained here Integrate Pure Script in your React Native project

Zubair
  • 915
  • 2
  • 9
  • 28

9 Answers9

7

That's how I resolved it.

Terminate your metro bundler > react-native link > react-native run-ios

It was not bundling because of some errors which was not showing in the simulator but just this error was thrown.

Payel Dutta
  • 742
  • 10
  • 23
6

create index.js, index.android.js and index.ios.js whith the same content. I do have all of them and it solved my issue

6axter82
  • 569
  • 2
  • 8
  • 19
1

I have also faced the same issue when I changed the name of images saved in my local directory. In my case, I have just restarted metro bundler, deleted the app, and restarted the app. Issue was fixed for me.

Dharman
  • 30,962
  • 25
  • 85
  • 135
Akhzar Nazir
  • 724
  • 9
  • 13
1

Make sure that when you restart the expo project you do so with expo start -c -c throws out the cache, otherwise the problem persisted for me.

Mister_CK
  • 668
  • 3
  • 13
0

Try this:

npx react-native-asset

then:

react-native run-ios

simo
  • 23,342
  • 38
  • 121
  • 218
0

This issue is caused basically when some packages or images are not bundled properly, it might be caused because of improper assets path or internet issue when installing packages or reload issue. The expo bundles into a standalone library so it can be available immediately.

This error does not provide any stack to debug since it does not properly have the bundled data even for error stack.

I have just face few bundled scenarios

Scenario 1 => While the expo is running and we install a new library on fly, few times during this importing the library might not get bundled properly, so it's better to stop the expo and re-run, or try reloading the error in app. This will some time resolve the issue, or if there is some error it will show up the error stack

Scenario 2 => You have a customised asset director or have changed the asset path in app.json file improperly.

Please let me know in comments if there are any other scenarios

Nav Kumar V
  • 320
  • 2
  • 10
0

I had a metro bundler terminal window opened and whenever I was running npm run ios , it wasn't starting a new metro server, the problem was that. I closed the metro bundler terminal window and ran npm run ios and it opened a started a new metro server and the error was gone

Mahdieh Shavandi
  • 4,906
  • 32
  • 41
0

I had a same issue, then I did: rm -rf node_modules, npm install and restarted the metro (npm start). It worked.

Justin
  • 1
0

In Settings, go to Privacy > Local Network to see a list of every app that requested access. I solved by allowing my app to access to the local network. (Trying to run on physical iPhone device from my mac m1 on the same wifi).

Source

RimApp
  • 13
  • 3