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

Webpack + thread-loader build errors #4100

Closed
JohnKoutsoumpas opened this issue Jul 20, 2023 · 5 comments
Closed

Webpack + thread-loader build errors #4100

JohnKoutsoumpas opened this issue Jul 20, 2023 · 5 comments

Comments

@JohnKoutsoumpas
Copy link

  • Version: 1.46
  • Platform: Arch linux 6.4.4-arch1-1

Webpack build using thread-loader fails with random JSON Parsing errors.
This happens because thread-loader is communicating between its workers with inter-process communication using JSON messages. However, those JSON messages get corrupted (and JSON parse fails) and the reason is that the worker sends incomplete messages. Also another error happens a few seconds later: Error EPIPE that seems to be coming from nodejs.

I don't know how exactly thread-loader works, but by reading the code I understand this: There is a worker manager process and some worker processes, which write their messages to the stdout and a the worker manager reads them. It seems that the stdout write hangs or is prematurely EOF'd and the reading never finishes or it finishes with corrupted data which leads to these errors.

By downgrading libuv to 1.44.2, it builds successfully.

@vtjnash
Copy link
Member

vtjnash commented Jul 20, 2023

Do you have some example code? It sounds like the application failed to flush the stream before reusing some buffer or exiting.

@JohnKoutsoumpas
Copy link
Author

No I don't have example code.

The application in this case is the 'thread-loader' plugin of Webpack (https://github.com/webpack-contrib/thread-loader). if you think it is a bug of thread-loader, then I'll open an issue there too.

@JohnKoutsoumpas
Copy link
Author

JohnKoutsoumpas commented Jul 21, 2023

I opened an issue with thread-loader , where I gave a full repro code

@bnoordhuis
Copy link
Member

In the other issue you mention you're using node 16.20.1 but that version of node ships with libuv 1.43.0.

As both a node and libuv maintainer: mixing and matching arbitrary versions is not recommended, you do so at your own risk. Sometimes changes in libuv expose latent bugs in node.

@bnoordhuis
Copy link
Member

I'm going to close this because there isn't really anything actionable for us here at the moment. Let me know when there's reason to reopen.

@bnoordhuis bnoordhuis closed this as not planned Won't fix, can't repro, duplicate, stale Jul 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants