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

[v2] gatsby build hangs on WSL Ubuntu #6540

Closed
dustinheestand opened this Issue Jul 18, 2018 · 15 comments

Comments

Projects
None yet
@dustinheestand
Copy link

dustinheestand commented Jul 18, 2018

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(R) Core(TM) 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

@KyleAMathews

This comment has been minimized.

Copy link
Contributor

KyleAMathews commented Jul 18, 2018

I couldn't recreate this just now on my mac. Perhaps this is a linux problem? Also npm occasionally just won't install things correctly so weird problems like this can be fixed by deleting node_modules and reinstalling. Can you try that?

@dustinheestand

This comment has been minimized.

Copy link

dustinheestand commented Jul 18, 2018

I just had a try - didn't work. However I did manage to get gatsby build to work on the beta on a different Ubuntu machine. That machine is running Ubuntu 18.04 but otherwise has the same config.

Is there any way for me to pinpoint this issue better? The --verbose flag doesn't give me any new info.

@KyleAMathews

This comment has been minimized.

Copy link
Contributor

KyleAMathews commented Jul 18, 2018

@azangru

This comment has been minimized.

Copy link

azangru commented Jul 19, 2018

Just wanted to chime in and say that the build script hanged on my machine as well, only it happened at the Building static HTML for pages step, after the Building production JavaScript and CSS bundles successfully finished. I am running KDE Neon (based on ubuntu 16.04), node v8.9.4, npm v.6.2.0. Something fishy is going on here...

@azangru

This comment has been minimized.

Copy link

azangru commented Jul 19, 2018

Uh-oh, now it started working fine again. I swear it consistently hung after a fresh install of 2.0.0-beta.47. I removed node_modules and reinstalled dependencies several times, and it continued to freeze. And then, after one last reinstall, it started working again. Very strange.

@m-allanson

This comment has been minimized.

Copy link
Member

m-allanson commented Jul 19, 2018

@pieh reported some oddities with WSL and a recent Windows update. Maybe this is the same thing?

Edit: nevermind, looks like you're seeing this issue on other Linux machines too.

@piotrkwiecinski

This comment has been minimized.

Copy link
Contributor

piotrkwiecinski commented Jul 19, 2018

I've just checked the starter on my machine:

  System:
    OS: Linux 4.15 Ubuntu 18.04 LTS (Bionic Beaver)
    CPU: x64 Intel(R) Core(TM) i7-7700HQ CPU @ 2.80GHz
    Shell: 4.4.19 - /bin/bash
  Binaries:
    Node: 8.11.3 - /usr/bin/node
    Yarn: 1.7.0 - /usr/bin/yarn
    npm: 5.6.0 - /usr/bin/npm
  Browsers:
    Chrome: 67.0.3396.99
    Firefox: 61.0.1
  npmPackages:
    gatsby: next => 2.0.0-beta.48 
gatsby build
success open and validate gatsby-config — 0.007 s
success load plugins — 0.081 s
success onPreInit — 0.021 s
success delete html and css files from previous builds — 0.007 s
success initialize cache — 0.004 s
success copy gatsby files — 0.007 s
success onPreBootstrap — 0.000 s
success source and transform nodes — 0.009 s
success building schema — 0.057 s
success createPages — 0.000 s
success createPagesStatefully — 0.013 s
success onPreExtractQueries — 0.000 s
success update schema — 0.037 s
success extract queries from components — 0.010 s
success run graphql queries — 0.008 s — 1/1 153.93 queries/second
success write out page data — 0.002 s
success write out redirect data — 0.000 s
success onPostBootstrap — 0.000 s

info bootstrap finished - 1.647 s

success Building production JavaScript and CSS bundles — 7.605 s
success Building static HTML for pages — 0.731 s — 1/1 11.18 pages/second
info Done building in 9.985 sec

Seams to work.

@azangru

This comment has been minimized.

Copy link

azangru commented Jul 19, 2018

Right, got the issue (not sure whether it’s quite the same issue as reported in the original message) reliably reproduce on my machine:

Steps:

  1. use gatsby v.2.0.0-beta.42
  2. run gatsby build
  3. build completes successfully

...

  1. update gatsby to v.2.0.0-beta.47
  2. run gatsby build (while keeping the public folder generated during the previous run)
  3. build completes successfully

...

  1. stay on gatsby v.2.0.0-beta.47
  2. delete the public folder generated during the previous run
  3. run gatsby build
  4. build hangs at the stepBuilding static HTML for pages

===

Running ubuntu 16.04, node v8.9.4, npm v.6.2.0.

@sorja

This comment has been minimized.

Copy link

sorja commented Jul 21, 2018

I am on (legacy) WSL and I run also in the following problem:
gatsby build (or yarn build) hangs on ⠐ Building production JavaScript and CSS bundles
gatsby@next and works on macos

node 10.1.0
npm 6.1.0
yarn 1.6.0

@awidjaja

This comment has been minimized.

Copy link

awidjaja commented Jul 27, 2018

Building production JavaScript and CSS bundles never completed.

I am on Ubuntu WSL too

Distributor ID: Ubuntu
Description: Ubuntu 18.04 LTS
Release: 18.04
Codename: bionic

Gatsby version 2.0.0-beta.7
Yarn 1.7.0
Node v10.6.0

@joewood

This comment has been minimized.

Copy link

joewood commented Aug 17, 2018

Anyone found a workaround for this yet? Or insight into which stage is causing the problem?

@HriBB

This comment has been minimized.

Copy link

HriBB commented Aug 29, 2018

Check your memory
#7013 (comment)

@archilkarchava

This comment has been minimized.

Copy link

archilkarchava commented Aug 31, 2018

Updating to the latest windows insider build solved the issue for me.

@KyleAMathews

This comment has been minimized.

Copy link
Contributor

KyleAMathews commented Aug 31, 2018

👍 closing this. Please open a new issue if there's something we can do to help make using Gatsby smooth on WSL Ubuntu!

@missaci

This comment has been minimized.

Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment