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

WSL react-scripts build hangs when terser parallel is true #6723

Closed
agilecollab opened this issue Mar 27, 2019 · 0 comments · Fixed by #6732
Closed

WSL react-scripts build hangs when terser parallel is true #6723

agilecollab opened this issue Mar 27, 2019 · 0 comments · Fixed by #6732

Comments

@agilecollab
Copy link

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:
gatsbyjs/gatsby#12636

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

Successfully merging a pull request may close this issue.

1 participant