facebook/create-react-app

react-scripts@2.0.0-next: babel-preset-env configuration issues

alexeyraspopov opened this issue · 2 comments

Is this a bug report?

Yes

Did you try recovering your dependencies?

The issue appeared right after creating an app.

Environment

  1. node -v: 8.9.4
  2. npm -v: 5.6.0
  3. yarn -v: 1.3.2
  4. npm ls react-scripts (if you haven’t ejected): react-scripts@2.0.0-next.b2fd8db8

Then, specify:

  1. Operating system: macOS Sierra
  2. Browser and version (if relevant):

Steps to Reproduce

(Write your steps here:)

  1. yarn create react-app reproducing-app
  2. cd reproducing app && yarn add react-scripts@2.0.0-next.b2fd8db8
  3. Add async function* something() { } to index.js
  4. yarn start

Expected Behavior

The app starts, the code is compiled, async generators are transpiled using babel-preset-env

Actual Behavior

As reported in #3815 (comment):

Failed to compile.

./src/App.js
Syntax error: /Users/alexey/xxx/src/App.js: Support for the experimental syntax 'asyncGenerators' isn't currently enabled (25:15):

  23 |
  24 |
> 25 | async function* Act() {
     |               ^
  26 |
  27 | }
  28 |

Add @babel/plugin-proposal-async-generator-functions (https://git.io/vb4yp) to the 'plugins' section of your Babel config to enable transformation.
n3tr commented

I'm working on PR #4222, add @babel/plugin-proposal-async-generator-functions to support async generator function.

iansu commented

This has been fixed in babel 7.0.0-beta.46. We've upgraded our version of babel and will be releasing a new alpha of react-scripts 2.0 soon.