Hey — I'm on RN v0.21.0 using Code Push v1.10.0-beta, and as soon as I add the line import codePush from 'react-native-code-push'; into my project, I receive the error babelHelpers.asyncToGenerator is not a function. I found this issue which makes me think @brentvatne might know the solution per https://github.com/facebook/react-native/issues/4844. The contents of my .babelrc are as follows:
{
"presets": [ "react-native", "stage-0" ],
"plugins": [
"transform-decorators-legacy",
"transform-async-to-generator"
]
}

@niftylettuce This isn't a bug with CodePush, but rather, an issue with the packager when you use a custom Babelrc file. CodePush uses async/await and unfortunately this ends up causing issues, as you've seen with the linked bug. You would hit this issue if using any other library that uses async/await. The only solution that we've found it to either remove your custom babelrc or update the packager's Babel helpers file as mentioned in the RN bug you mentioned.
I resolved, here was my new .babelrc file:
{
"presets": [ "react-native" ],
"plugins": [
"transform-decorators-legacy",
"transform-do-expressions",
"transform-function-bind",
"transform-class-constructor-call",
"transform-export-extensions",
"syntax-trailing-function-commas",
"transform-exponentiation-operator"
]
}
I also ran the packager with --reset-cache to work: node_modules/react-native/packager/packager.sh --reset-cache.
Thank you and also thanks to @skevy for help over Slack in ExponentJS.
For further information, see here: https://github.com/facebook/react-native/issues/4844#issuecomment-204035720
I found maybe is the watchman problem, I use the react 0.41.2, it occured this issue, because I install the stage-0, error, so uninstall it, but still. finally, I delete all the project and git clone again, error still their! but same project is good at my PC! so, watchman watch-del-all, rebuild, everything OK!
ultimate solution
brew uninstall watchman
@niftylettuce thanks, your solution works for me.
Most helpful comment
I resolved, here was my new
.babelrcfile:I also ran the packager with
--reset-cacheto work:node_modules/react-native/packager/packager.sh --reset-cache.Thank you and also thanks to @skevy for help over Slack in ExponentJS.