Skip to content
This repository has been archived by the owner on Mar 6, 2024. It is now read-only.

Hang build on Windows #70

Closed
Tom910 opened this issue Aug 9, 2016 · 21 comments
Closed

Hang build on Windows #70

Tom910 opened this issue Aug 9, 2016 · 21 comments

Comments

@Tom910
Copy link
Contributor

Tom910 commented Aug 9, 2016

Hangs on Windows, all node processes hanging to 0% CPU usage. At the same time, on Mac OS very well. The project is large, more than 5000 modules webpack

How can I get the error logs in the node?

[email protected], configuration like examples/webpack2-extract-react

@amireh
Copy link
Owner

amireh commented Aug 10, 2016

You should be able to set the verbose and debug options to true when you configure happypack and then it will output much more information to the console.

@Tom910
Copy link
Contributor Author

Tom910 commented Aug 23, 2016

@amireh I have included this mode. And he did not show anything new. there is the creation of modules and randomly place all the freezes and progression can not be extended. I checked on 4+ Windows computers.

Tried to disable cache, threadPool, does not help.
If you run only one instance happypack, going normally. With 2+ freezes.

@amireh amireh added the bug label Aug 23, 2016
@Tom910
Copy link
Contributor Author

Tom910 commented Aug 24, 2016

@amireh
Copy link
Owner

amireh commented Sep 9, 2016

@Tom910 I looked at this today on Windows 7 using Node.js 6.5.0 (installed directly from https://nodejs.org) and the examples that use multiple happypack plugins are all working:

  1. https://github.com/amireh/happypack/blob/master/examples/webpack2-extract-react/webpack.config.js
  2. https://github.com/amireh/happypack/blob/master/examples/transform-loader/webpack.config.js

The first one uses a shared thread pool, while the second doesn't. I'm thinking this is probably related to your config. Can you share that config (or the parts where happypack is involved) with us?

@Tom910
Copy link
Contributor Author

Tom910 commented Sep 9, 2016

@amireh Config like https://github.com/amireh/happypack/blob/master/examples/webpack2-extract-react/webpack.config.js .
In the examples above problem is not repeated. Repeats in a large project, where 5000+ webpack modules.

@amireh
Copy link
Owner

amireh commented Sep 9, 2016

Hmm, that makes it a little difficult. I will try compiling the only big project I have access to on Windows but it's not as big as yours (~3k modules) and hope I can reproduce the issue.

@amireh
Copy link
Owner

amireh commented Sep 9, 2016

Curious, how long does the build usually take without happypack?

@Tom910
Copy link
Contributor Author

Tom910 commented Sep 9, 2016

~200 seconds in dev mode. With cache and restart. The first time even much more)

@trash
Copy link

trash commented Jul 7, 2017

I can't weigh in on a solution for the root cause but I can say that I've been having the same problem as well and was able to fix it by upping the number of threads for HappyPack.

The hanging was caused specifically when building our tests. We use karma with a script that dynamically pulls in all our tests into one large bundle (probably several hundred modules, with the tests being fairly sizeable). Locally on my fairly beefy Windows machine (4790k 4GHz i7, 16 GB RAM, SSD) it would only hang if I didn't partially prepopulate the cache by building the source files first. However on our CI machine (also Windows) it would hang every time, even with a partially prepopulated cache. The CI machine is probably a bit less beefy specs-wise and is shared across multiple builds. The takeaway seems to be that system performance/utilization plus the number of imported modules are directly related to whether the build hangs or not. Thankfully, in my case I was able to get it to work consistently without hanging by changing the number of threads from 2 to 4.

We're using a config similar to the ForkTSChecker/ts-loader config example: https://github.com/amireh/happypack/blob/master/examples/ts-loader--webpack2/webpack.config.js

@amireh
Copy link
Owner

amireh commented Aug 26, 2017

This should (hopefully) be fixed in 4.0.0-beta.4 - can you try that and confirm?

@traverse
Copy link

traverse commented Sep 4, 2017

Used 4.0.0-beta.1 back when it was released and it was hanging constantly for me so I reverted to pre-beta. Currently I'm using 4.0.0-beta.5 and I can say I haven't had any hanging as of yet. So I think it's fixed 👍

@Knagis
Copy link

Knagis commented Sep 6, 2017

On my machine it hanged (during initialization) with node 6.0.0 but does not hang with 8.4.0 - so there are node issues to consider as well

@amireh
Copy link
Owner

amireh commented Sep 6, 2017

@Knagis can you try node 6 with 4.0.0-beta.5? I think it should be fixed for all node versions

@Knagis
Copy link

Knagis commented Sep 7, 2017

I did try 4.0.0-beta5 only with node 6.0.0 and it did not work. I did not try with 6.latest. But from what I investigated, it was a node bug, because fork() did not start the process at all, it wasn't about messaging the child process.

@amireh
Copy link
Owner

amireh commented Sep 11, 2017

Official release [email protected] is out on NPM now and should have the patch for this issue. I'll be closing this but feel free to re-open if the issue pops up again (or open another one.)

Thanks to everyone for troubleshooting.

@amireh amireh closed this as completed Sep 11, 2017
@dfenster
Copy link

I am getting the hang on 4.0.0

lerna info version 2.1.2
lerna info scope @sstk/browser-bios
@sstk/browser-bios: > @sstk/[email protected] build /home/dfenster/code/sstk/packages/browser-bios
@sstk/browser-bios: > UV_THREADPOOL_SIZE=100 webpack
@sstk/browser-bios: Happy[jsx]: Version: 4.0.0. Threads: 5 (shared pool)
@sstk/browser-bios: Happy[jsx]: All set; signaling webpack to proceed.
@sstk/browser-bios: Happy[stylecss]: Version: 4.0.0. Threads: 5 (shared pool)
@sstk/browser-bios: Happy[stylecss]: All set; signaling webpack to proceed.

@lbogdan
Copy link

lbogdan commented Mar 2, 2018

Unfortunately we still see this behavior at CodeSandbox. Tried with both 4.0.0 and 4.0.1. Linux & MacOS work just fine.

@amireh If you're interested in looking into this, please let me know, so I can give you more details about my environment and the steps to reproduce it. I'd do it myself, but I haven't got the slightest idea of what to look at, if you could guide me a bit, that'd also be appreciated. Thanks!

@dfenster
Copy link

dfenster commented Mar 2, 2018

My issue resolved itself with Windows Update a couple months back.

@lbogdan
Copy link

lbogdan commented Mar 2, 2018

What Windows version? I'm on an up-to-date Windows 7 Ultimate.

@dfenster
Copy link

dfenster commented Mar 2, 2018

Windows 10 through WSL

@lbogdan
Copy link

lbogdan commented Mar 2, 2018

Update: sometimes it just hangs, sometimes I get this just before it hangs:

undefined:1

^

SyntaxError: Unexpected token  in JSON at position 0
    at JSON.parse (<anonymous>)
    at Pipe.channel.onread (internal/child_process.js:480:28)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

7 participants