-
-
Notifications
You must be signed in to change notification settings - Fork 27k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
for...of inside generator function causes transpilation failure #4627
Comments
Directly including regenerator in preset-react-app's plugins list predates the existence of preset-env. Preset-env will transpile generators if browserslist requires it. Therefore I think the correct solution is simply to remove transform-regenerator here. However I am having a truly awful time trying to verify it, or even reliably reproduce the problem I was having in the first place. |
OK I have been able to verify locally that removing regenerator does not eliminate transpilation of generator functions when preset-env dictates that they need to be transpiled. |
Regenerator is already included by preset-env. Fixes facebook#4627
Regenerator is already included by preset-env. Fixes #4627
Regenerator is already included by preset-env. Fixes facebook#4627
preset-react-app has the issue described here: https://github.com/leebenson/babel-preset-node5/issues/4
Is this a bug report?
Yes
Steps to Reproduce
set a browserslist in package.json which which includes only browsers which support
for...of
loops, e.g.Attempt to build an application which contains a
for...of
loop inside a generator function, like so:Expected Behavior
The app does not fail compilation
Actual Behavior
This error is shown:
Failed to compile
Module build failed: Error: unknown Statement of type "ForOfStatement"
at Array.forEach ()
Reproducible Demo
[none]
The text was updated successfully, but these errors were encountered: