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.

webpack causes ECONNRESET during build when running on a M1 MacBook

See original GitHub issue

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: –

Issue Analytics

  • State:open
  • Created 2 years ago
  • Comments:12 (4 by maintainers)

github_iconTop GitHub Comments

7reactions
otaviobpscommented, May 25, 2022

@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 issue

5reactions
Anatanokamicommented, Mar 10, 2022

Think I found the problem:

@import url("https://fonts.googleapis.com/css2?family=Roboto");

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Is there a way to solve ECONNRESET error when using npm ...
Solution 1: MAC + LINUX. run this command with sudo sudo npm install -g yo. Windows. run cmd ...
Read more >
Install and Run Redash on Apple M1 Pro Chip
Issue Summary Hi Redash community, I was trying to install and run Redash using docker on my macbook with M1 Pro chip.
Read more >
Npm run build failing on MAC M1 - Questions - n8n community
Hi @sushant_a, I encountered the same error recently, on a Mac M1. Have you checked that you are running node js on version...
Read more >
Why only in MAC?: Nodejs proxy ECONNRESET…
The most likely cause is an error deep within your application stack. Given the size if anything nodejs, I doubt you'll ever find...
Read more >
npm install network timeout | The AI Search Engine You Control
I had the same problem. The reason - wrong proxy was configured and because of that npm was unable to download packages. So...
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