gatsby: [v2] gatsby build hangs on WSL Ubuntu
Description
Build hangs on “Building production Javascript and CSS bundles,” after “bootstrap finished.” This doesn’t happen on Gatsby v1, or with gatsby develop.
Steps to reproduce
- Make a new gatsby site using command:
gatsby new tutorial-part-one https://github.com/gatsbyjs/gatsby-starter-hello-world#v2. - Run
gatsby build.
Expected result
Gatsby should build the production site.
Actual result
Gatsby hangs on “Building production Javascript and CSS bundles.” I let it run for 10 minutes and then quit. This occurs on both the gatsby-cli
Environment
- System:
- OS: Linux 4.4 Ubuntu 16.04.4 LTS (Xenial Xerus) (wsl on Windows build 17692)
- CPU: x64 Intel® Core™ i7-8550U CPU @ 1.80GHz
- Shell: 5.1.1 - /usr/bin/zsh
- Binaries:
- Node: 8.11.3 - /usr/local/bin/node
- npm: 6.2.0 - /usr/local/bin/npm
- npmPackages:
- gatsby: next => 2.0.0-beta.46
- gatsby-plugin-react-helmet: next => 3.0.0-beta.3
- npmGlobalPackages:
- gatsby-cli: 2.0.0-beta6
- also occurs on -gatsby-cli: 1.1.58
File contents (if changed)
gatsby-config.js: N/A
package.json: N/A
gatsby-node.js: N/A
gatsby-browser.js: N/A
gatsby-ssr.js: N/A
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Reactions: 2
- Comments: 16 (6 by maintainers)
Commits related to this issue
- fix(gatsby): workaround webpack terser plugin hanging on WSL (#12636) * Fix #6540 and #7013 * Use sindresorhus/is-wsl instead of a custom WSL check * Add some context — committed to gatsbyjs/gatsby by LubomirGeorgiev 5 years ago
Guys, looking for a workaround, I found out that the problem is caused during the uglify process when using wsl (there are some notes at webpack git talking about uglify hanging when parallel: true).
Setting parallel:false in node_modules/gatsby/dist/utils/webpack-utils.js -> plugins.minifyJs solved the issue for me.
Maybe it can be useful =]