webpack: webpack causes ECONNRESET during build when running on a M1 MacBook
Bug report
What is the current behavior?
In some of my bigger existing projects using webpack and webpack-dev-server, npx webpack and npx webpack serve do no longer work as expected since I moved over to my new MacBook Pro (M1 chip).
When running either of the two commands, It shows the following error:
>> npx webpack
node:events:498
throw er; // Unhandled 'error' event
^
Error: read ECONNRESET
at TLSWrap.onStreamRead (node:internal/stream_base_commons:217:20)
Emitted 'error' event on ClientRequest instance at:
at TLSSocket.socketErrorListener (node:_http_client:442:9)
at TLSSocket.emit (node:events:520:28)
at emitErrorNT (node:internal/streams/destroy:157:8)
at emitErrorCloseNT (node:internal/streams/destroy:122:3)
at processTicksAndRejections (node:internal/process/task_queues:83:21) {
errno: -54,
code: 'ECONNRESET',
syscall: 'read'
}
This happens less often if the project is smaller.
Occurs when using both the current its version of Node (16.14.0) as well as when using the latest (17.7.0). It doesn’t occur when using Node 15.14.0 (still delivered as an x64 without native M1 support).
As everything else works and it’s just webpack that’s running into this, I am now opening this here.
If the current behavior is a bug, please provide the steps to reproduce.
What is the expected behavior?
Other relevant information: webpack version: 5.70.0 Node.js version: 16.14.0 / 17.7.0 Operating System: MacOS 12.2.1 Additional tools: –
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 15 (6 by maintainers)
@Anatanokami I think the import should be
@import (css) url("https://fonts.googleapis.com/css2?family=Roboto");. Mine was equal to yours, adding the(css)solved the issueThink I found the problem:
Seems to be that it’s either a less-loader or a css-loader issue. When I remove the font family import from my .less file, I cannot reproduce this any longer.
So it is definitely not a bug for here.
please create a reproducible repo.
I had the same problem and I had no idea what is wrong, because on Windows everything is okay, thank you so much, you helped a lot!
No other instances running, double checked that. And it also happens when not trying to launch the dev server.
Doesn’t seem to be a common issue, otherwise there’d be more people. At least one who’s having the same problem in combination with webpack/webpack-dev-server and there seems to be an open bug also on the Node.JS repos: https://github.com/nodejs/node/issues/27916
I’ll try to do a clean install of node, maybe something got messed up by nvm.
Thanks for your help so far. Much appreciated.