question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[v2] gatsby build hangs on WSL Ubuntu

See original GitHub issue

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

  1. Make a new gatsby site using command: gatsby new tutorial-part-one https://github.com/gatsbyjs/gatsby-starter-hello-world#v2.
  2. 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

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:2
  • Comments:16 (6 by maintainers)

github_iconTop GitHub Comments

13reactions
missacicommented, Nov 14, 2018

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 =]

0reactions
LubomirGeorgievcommented, Mar 19, 2019

This issue has been fixed in #12636

Read more comments on GitHub >

github_iconTop Results From Across the Web

Gatsby doesn't seem to build on Windows Subsystem ...
Fix: Update to WSL2 by following the instructions here: https://learn.microsoft.com/en-us/windows/wsl/wsl2-kernel.
Read more >
Install Gatsby.js on Windows
Open your WSL terminal (ie. Ubuntu 18.04). Use npm to install the Gatsby CLI: npm install -g gatsby-cli . Once installed, check the...
Read more >
Running gatsby develop just hangs forever : r/gatsbyjs
I've tried changing my node version, updating yarn and even removing it from the machine entirely. Nothing works. Any ideas?
Read more >
Learning React and Gatsby by building a blog - dev
When I run the gatsby develop develop command, ... You mentioned WSL, but seeing as WSL2 will only support a “proper” Linux kernel...
Read more >
A quick speed up for node/gatsby Development on ...
The tooling works great, but WSL2 is a little slow for files shared between ... move_node_modules.sh can greatly speed up builds! Wsl 2....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found