Jean Lebrument
Jean Lebrument

Reputation: 5169

"babelHelpers.asyncToGenerator is not a function" on React-Native 0.16.0 and 0.17.0

I updated React-Native from 0.14.0 to 0.16.0 and from now, I have errors at runtime:

https://cloud.githubusercontent.com/assets/3106676/11873009/b5b3aee2-a4d8-11e5-96db-831de137af06.png

https://cloud.githubusercontent.com/assets/3106676/11873609/c1cc1c34-a4db-11e5-981f-8d7d8c653819.png

Here are the npm dependencies:

"dependencies": {
  "async": "^1.5.0",
  "immutable": "^3.7.6",
  "react-native": "^0.16.0",
  "react-native-contacts": "../../react-native-contacts",
  "react-native-contacts-rx": "^1.0.1",
  "react-native-gifted-messenger": "0.0.7",
  "react-native-i18n": "0.0.6",
  "react-redux": "^4.0.1",
  "redux": "^3.0.5",
  "rx": "^4.0.7"
},
"devDependencies": {
  "babel-eslint": "^5.0.0-beta6",
  "eslint": "^1.10.3",
  "eslint-config-airbnb": "^2.1.1",
  "eslint-plugin-react": "^3.11.3",
  "events": "^1.1.0",
  "flux": "^2.1.1",
  "keymirror": "^0.1.1",
  "lodash": "^3.10.1",
  "redux-devtools": "^3.0.0"
}

And my .babelrc file:

{
  "retainLines": true,
  "compact": true,
  "comments": false,
}

Any suggestions?

Upvotes: 2

Views: 1875

Answers (2)

Jayem
Jayem

Reputation: 215

I had this exact same problem you can check out what I did here - https://stackoverflow.com/a/53069785/2884655

But in short I just imported the babel-plugin-transform-async-to-generator module into my project and added it into my babelrc file

Upvotes: 0

Russell Maxfield
Russell Maxfield

Reputation: 968

The Questions was answered in an issue @Jean Lebrument submitted. Positing answer here for stumblers like myself...

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

The problem is most likely in your .babelrc file. If you experience this problem, compare your .babelrc file to react natives default one. Try removing the file or building off of default one, adding the features that you need.

Make sure to restart your packager, stop, and re-run your project.

Upvotes: 1

Related Questions