'babelhelpers.asynctogenerator Is Not A Function' Error
Expected Behavior App to load as it does on android. Actual Behavior Error: babelHelpers.asyncToGenerator is not a function Environment: OS: macOS Sierra 10.12.1 Node: 7.9.0 Yarn:
Solution 1:
Check your .babelrc
file. Is it including the babel transform-async-to-generator
plugin? If so, remove it. The babel helpers that React Native includes do not include the helper for that transform. I'm not sure how to add it without generating a new set of helpers and including them in your build.
If that plugin is not in your babel config, maybe one of the library dependencies you are using has it.
Solution 2:
So I use expo with my project and I had this exact same issue a few days ago, was bothering the hell out of me... ultimately fixed it by importing the library - babel-plugin-transform-async-to-generator
Here is my babelrc file for reference though: `
{
"presets": ["babel-preset-expo"],
"env": {
"development": {
"plugins": [
"transform-async-to-bluebird",
"transform-async-to-generator",
"transform-react-jsx-source",
[
"module-resolver",
{
"root": ["./src"]
}
]
]
},
"production": {
"plugins": [
"transform-async-to-bluebird",
"transform-async-to-generator",
"transform-remove-console",
"transform-react-jsx-source",
[
"module-resolver",
{
"root": ["./src"]
}
]
]
}
}
}
`
Post a Comment for "'babelhelpers.asynctogenerator Is Not A Function' Error"