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
  • 885
  • 2
  • 10
  • 26
  • Can you try to run react-native link and react-native start --reset-cache? Maybe this fixes your problem – Marco Dec 19 '17 at 09:03
  • @Marco it ran these command but still getting same issue. – Zubair Dec 19 '17 at 10:02
  • Did you already try removing node_modules and running npm install again? – Marco Dec 19 '17 at 10:04
  • @Marco yeah I did, still getting same error... when you build your project . using xcode it automatically runs npm start command... – Zubair Dec 19 '17 at 10:18
  • @Marco I've edited the question, please read the edit, I hope that would clear situation. – Zubair Dec 19 '17 at 10:21
  • @Zubair I am getting the same issue while trying to run on a real device. Have you found any solution meanwhile? – 6axter82 Jan 18 '18 at 15:15
  • @6axter82 how did you create your project? using create-react-native-app or react-native init? – Zubair Mar 14 '18 at 08:53

7 Answers7

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
  • 582
  • 4
  • 17
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
  • 510
  • 1
  • 8
  • 17
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
  • 26,923
  • 21
  • 73
  • 125
Akhzar Nazir
  • 637
  • 7
  • 12
0

Try this:

npx react-native-asset

then:

react-native run-ios

simo
  • 22,134
  • 35
  • 107
  • 202
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
  • 250
  • 1
  • 9
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
  • 3,495
  • 25
  • 32
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