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
  • #6723
Closed
Open
Issue created Mar 27, 2019 by Administrator@rootContributor

WSL react-scripts build hangs when terser parallel is true

Created by: agilecollab

Is this a bug report?

Yes, this bug affecting use with react-create-app on WSL systems

Did you try recovering your dependencies?

Yes Yarn version 1.13.0

Which terms did you search for in User Guide?

webpack hang wsl terser parallel

Environment

Environment Info:

System: OS: Linux 4.4 Ubuntu 18.04.1 LTS (Bionic Beaver) CPU: x64 Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz Binaries: Node: 10.13.0 - ~/.nvm/versions/node/v10.13.0/bin/node Yarn: 1.13.0 - /usr/bin/yarn npm: 6.4.1 - ~/.nvm/versions/node/v10.13.0/bin/npm npmPackages: react: ^16.7.0 => 16.8.5 react-dom: ^16.7.0 => 16.8.5 react-scripts: 2.1.1 => 2.1.1 npmGlobalPackages: create-react-app: Not Found

Steps to Reproduce

(Write your steps here:)

  1. setup WSL
  2. run yarn build in project with code splitting; wasn't an issue until we introduced code splitting

Expected Behavior

Expected yarn build to complete or throw an error.

Actual Behavior

Yarn build hangs during webpack build. Last output we see from react-scripts build is "Creating an optimized production build... "

After review, this is caused by webpack TerserPlugin. It appears that WSL has issue with running TerserPlugin with parallel configuration property set to true.

Temporary Fix: To those that may be affected by this issue, you can update .node_modules/react-scripts/config/webpack.config.prod.js and set the TerserPlugin config option parallel to false.

Suggested Fix: Add environment variable check to determine if Terser should run in parallel:

const shouldTerserRunParallel = process.env.TERSER_PARALLEL !== 'false';

Reproducible Demo

Issue has been seen with other projects using TerserPlugin on WSL: https://github.com/gatsbyjs/gatsby/pull/12636

Assignee
Assign to
Time tracking