React-native: Unhandled JS Exception: TypeError when running react-native run-ios

Created on 22 Feb 2017  路  9Comments  路  Source: facebook/react-native

Description

Hello,

I have a react native project, created with 'react-native init ProjectName'. react-native-cli is installed globally. And i have a custom webpack.config.js
When i run the command 'react-native run-ios', i should get the welcome message for React Native in the simulator instead i get a red screen inside the simulator with an exception:

screen shot 2017-02-22 at 9 31 26 am

Additional Information

  • React Native version: 0.41.2
  • Platform: iOS and Android
  • Operating System: MacOS Sierra 10.12.3
  • Xcode: 8.2.1

Any ideas would be appreciated!

Locked

Most helpful comment

I use this combo command, after that It's comeback to worked.

watchman watch-del-all
rm -rf ./node_modules
npm cache clean
npm i
./node_modules/react-native/packager/packager.sh start --resetCache

note: .babelrc

{
"presets": ["react-native"]
}

All 9 comments

Hello! React Native has its own packager and does not use Webpack. Sorry! Try out the react-native tag on Stack Overflow

Hi @brentvatne, I am @SvetlanaBarros 's coworker.

For clarifications : we do not use webpack in the build process of react-native, only the web application.

The error that is shown above only happens on @SvetlanaBarros 's computer whilst I have no problem running react-native what so ever.

We have tried searching on Google, StackOverflow, react-native's issues, etc.

I too am on :

  • React Native version: 0.41.2
  • Platform: iOS and Android
  • Operating System: MacOS Sierra 10.12.3
  • Xcode: 8.2.1

Hi @brentvatne,

I noticed this morning that i was in a different network than my collegue @brodeuralexis. I switched from the network i was on and i had no longer the error, the simulator runs the app with no problem.

Thanks for your help anyway

I'm getting this error too, on:
react-native-cli: 2.0.1
react-native: 0.41.2

This started happening mid branch after doing nothing particularly interesting. Now, even if I go back a few commits, I still get the error. I can no longer run any branch of my app... So strange. Trying everything...

me too
last night It's working pretty perfect but after refactoring little thing. I'm getting this error.

  • react-native-cli: 2.0.1
  • react-native: 0.42.0
  • MacOS Sierra 10.12.3
  • Xcode: 8.2.1

I use this combo command, after that It's comeback to worked.

watchman watch-del-all
rm -rf ./node_modules
npm cache clean
npm i
./node_modules/react-native/packager/packager.sh start --resetCache

note: .babelrc

{
"presets": ["react-native"]
}

I'm getting the same exact error, but nothing on here has worked for me so far.

  • react-native-cli: 4.1.2
  • react-native: 0.42.3
  • MacOS Sierra 10.12.3
  • Xcode: 8.3

The error in my case is caused due to my .babelrc which has the following content

{
  "plugins": [
    "transform-class-properties",
    "transform-async-to-generator",
    "transform-decorators-legacy"
  ],

  "presets": [
      "es2015",
      "react",
      "react-native"
  ],

  "env": {
    "development": {
      "presets": [
        "react-hmre"
      ]
    }
  }
}

If I remove everything except for the react-native preset it works fine.

I don't know if anyone is still running into this problem, but I was able to solve the problem and document it on stackoverflow.

Was this page helpful?
0 / 5 - 0 ratings