Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
  • C create-react-app
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 1,547
    • Issues 1,547
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 417
    • Merge requests 417
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • Meta
  • create-react-app
  • Issues
  • #4627
Closed
Open
Issue created Jun 17, 2018 by Administrator@rootContributor

for...of inside generator function causes transpilation failure

Created by: conartist6

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.

  "browserslist": {
    "production": ["last 1 chrome versions"]
  },

Attempt to build an application which contains a for...of loop inside a generator function, like so:

function* willFailCompilation(array) {
  for (const item of array) {
      yield item;
  }
}

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]

Assignee
Assign to
Time tracking