You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
"babelHelpers.asyncToGenerator is not a function" on React-Native 0.16.0 and 0.17.0 #4844
Hey JeanLebrument, thanks for reporting this issue!
React Native, as you've probably heard, is getting really popular and truth is we're getting a bit overwhelmed by the activity surrounding it. There are just too many issues for us to manage properly.
If you don't know how to do something or not sure whether some behavior is expected or a bug, please ask on StackOverflow with the tag react-native or for more real time interactions, ask on Discord in the #react-native channel.
If this is a feature request or a bug that you would like to be fixed, please report it on Product Pains. It has a ranking feature that lets us focus on the most important issues the community is experiencing.
We welcome clear issues and PRs that are ready for in-depth discussion. Please provide screenshots where appropriate and always mention the version of React Native you're using. Thank you for your contributions!
I can't help but find the solutions posted here not really helpful
I agree that the answer of @skevy does a great deal of explanation and gives a great workaround for the stage-0-folks
If babel's mechanisms are broken on purpose to achieve better performance, fine - but I'd expect an alternative "react-native way of adding my own presets or plugins"
Right now, we are failing to get rid of the error described in #4831
Activity
facebook-github-bot commentedon Dec 17, 2015
Hey JeanLebrument, thanks for reporting this issue!
React Native, as you've probably heard, is getting really popular and truth is we're getting a bit overwhelmed by the activity surrounding it. There are just too many issues for us to manage properly.
react-nativeor for more real time interactions, ask on Discord in the #react-native channel.satya164 commentedon Dec 19, 2015
Try clearing the package cache may be?
filod commentedon Dec 21, 2015
+1 same issue here
rm -rf $TMPDIR/react*seems no usefilod commentedon Dec 21, 2015
@JeanLebrument i remove my own
./babelrcin root dir, then everything goes alright.don't know why but works.
JeanLebrument commentedon Dec 21, 2015
Thanks for your answer @filod but I need to use the preset stage-0 for my project.
satya164 commentedon Dec 22, 2015
@JeanLebrument All transforms in
stage-0are already enabled in React Native.brentvatne commentedon Jan 1, 2016
@satya164 - I don't think that is the case actually, it uses these plugins by default: https://github.com/facebook/react-native/blob/master/packager/react-packager/.babelrc
Your babelrc doesn't have any plugins or presets enabled, and babel6 doesn't enable any by default. You'll need to add those to your babelrc :)
satya164 commentedon Jan 2, 2016
@brentvatne Oh, I mistakenly said stage-0.
justinr1234 commentedon Feb 26, 2016
@brentvatne answer is out of date for anyone stumbling here: https://github.com/facebook/react-native/blob/e6cb02d61af82832016bafb259a1b0d3039a357e/babel-preset/README.md
babel-preset-react-native is the preferred way to integrate your own babelrc
JAStanton commentedon Feb 27, 2016
Even with
babel-preset-react-nativeI still get this error.LeoLeBras commentedon Feb 29, 2016
The same for me ! The following example doesn't work for me in React Native : https://goo.gl/0JEOwJ.
My babelrc :
I remove my own babelrc in root dir, then everything goes alright ! But it seems impossible to use custom babelrc.
nevir commentedon Mar 1, 2016
So, it appears that the RN packager has its own implementation of
babelHelpers, which doesn't include an implementation forasyncToGeneratorbreezykermo commentedon Mar 2, 2016
@nevir - is there no way to use stage-0 async functions in react-native, then?
justinr1234 commentedon Mar 2, 2016
I'll leave the same comment here from: este/este#662 (comment)
It appears you can modify the react-native helpers file to (maybe?) fix this issue. Replace the helpers you find at /node_modules/react-native/packager/react-packager/src/Resolver/polyfills/babelHelpers.js (https://github.com/facebook/react-native/blob/master/packager/react-packager/src/Resolver/polyfills/babelHelpers.js) with the ones either generated yourself (how to: http://stackoverflow.com/questions/33703919/how-to-use-babel-6-external-helpers-in-the-browser) or from this code snippet:
14 remaining items
Fix babelHelpers.typeof is not a function
madmaw commentedon Feb 15, 2017
None of the above worked for me, but it was an issue to do with something, somewhere in the cache. I resolved the issue by running
react-native start --reset-cache
leoselig commentedon Mar 31, 2017
I can't help but find the solutions posted here not really helpful
I agree that the answer of @skevy does a great deal of explanation and gives a great workaround for the
stage-0-folksIf babel's mechanisms are broken on purpose to achieve better performance, fine - but I'd expect an alternative "react-native way of adding my own presets or plugins"
Right now, we are failing to get rid of the error described in #4831
jcollum commentedon Apr 27, 2017
I ran into this issue and the only way to solve it was to delete my
.babelrcand runrm -rf $TMPDIR/react* && npm start --reset-cache.RN 0.43.2
honeyjie commentedon Aug 16, 2017
@liuliangsir I tried many ways, on the end, your suggestion solved my problem, Thanks
EthanLin-TWer commentedon Aug 16, 2017
楼上竟然和我的偶像同名,还以为偶像也来写前端了
normeno commentedon Aug 17, 2017
@jcollum Thanks! this solution work for me
honeyjie commentedon Aug 17, 2017
@liuliangsir You are right, Thanks for your reminder
hbarylskyi commentedon Nov 10, 2017
Nothing from here helped me so I made a workaround which seems to work with no problem:
npm i async-to-generatorThen, somewhere in your app:
P.S.: what caused the problem was some library which I had installed. Changing .babelrc in that lib as described above also solved the problem
tangkunyin commentedon May 4, 2018
For me, When I remove
"babel-preset-stage-0": "^6.24.1"from package.json and "state-0" from .babelrc. It works wellmariowise commentedon Jun 9, 2018
This happened to me in the released apk but not in the development environment. Any ideas?
AndreyPatseiko commentedon Jun 22, 2018
I find solution microsoft/react-native-code-push#271. Answer niftylettuce