Skip to content
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 loop in generator function lead to compilation error with [email protected] #4340

Closed
phahn opened this issue Apr 22, 2018 · 3 comments

Comments

@phahn
Copy link

phahn commented Apr 22, 2018

Is this a bug report?

Yes

Did you try recovering your dependencies?

Yes

Which terms did you search for in User Guide?

generator

Environment

  1. node -v: v8.1.3
  2. npm -v: 5.8.0
  3. yarn --version (if you use Yarn): 1.6.0
  4. npm ls react-scripts (if you haven’t ejected): [email protected]

Then, specify:

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

Steps to Reproduce

  1. Create a new project create-react-app test
  2. Update dependency to [email protected]
  3. Add function* test() { for (let num of [1,2,3]) { yield console.log("test"); } }
    to index.js
  4. yarn install
  5. yarn start, add default target browser

Expected Behavior

In [email protected] this shows a running page.

Actual Behavior

With [email protected] it fails to compile: ./src/index.js
Module build failed: Error: unknown Statement of type "ForOfStatement"
at Array.forEach (native)

Reproducible Demo

@francisu
Copy link
Contributor

I can reproduce this with the above steps. See also: #4627

@conartist6
Copy link
Contributor

conartist6 commented Jun 29, 2018

Yep. I have a PR out to fix it too. #4630 Just rebased it to resolve conflicts. I imagine it's the kind of thing that will be addressed once CI is unbroken.

@Timer Timer added this to the 2.0.0 milestone Jul 23, 2018
@Timer Timer modified the milestones: 2.0.x, 2.x, 2.0.0 Sep 26, 2018
@Timer Timer closed this as completed Sep 27, 2018
@Timer
Copy link
Contributor

Timer commented Sep 27, 2018

Fixed in #4630

@lock lock bot locked and limited conversation to collaborators Jan 12, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants