Webpack-hot-middleware: net::ERR_INCOMPLETE_CHUNKED_ENCODING in node v8.0 + chrome 58.0.3029.110

Created on 1 Jun 2017  路  13Comments  路  Source: webpack-contrib/webpack-hot-middleware

Seeing this error http://localhost:4000/__webpack_hmr net::ERR_INCOMPLETE_CHUNKED_ENCODING in browser console after upgrading to node v8. As a result, code injection fails for certain updates.

UPDATE:
Here's what I've tried and known to work

  • About 15 seconds after launching application, this error pops up in the console
  • About 30 ~ 45 seconds later, hmr works again
  • And then, it randomly breaks. Haven't been able to determine the criteria upon which it fails
  • hmr was stable in node v7

reference: https://github.com/egoist/poi/issues/179

Most helpful comment

From what I can tell, node is killing the request due to a timeout.

Edit: I think it might be this: https://github.com/nodejs/node/pull/2534. So there is now a 5s keep-alive timeout that can be set via keepAliveTimeout.

It looks like keepAliveTimeout needs to be set on the server before any requests - as I understand Express middleware works on requests.

const server = app.listen(4000, () => {
  server.keepAliveTimeout = 0;
});

Using a heartbeat of 5s or less also works.

All 13 comments

From what I can tell, node is killing the request due to a timeout.

Edit: I think it might be this: https://github.com/nodejs/node/pull/2534. So there is now a 5s keep-alive timeout that can be set via keepAliveTimeout.

It looks like keepAliveTimeout needs to be set on the server before any requests - as I understand Express middleware works on requests.

const server = app.listen(4000, () => {
  server.keepAliveTimeout = 0;
});

Using a heartbeat of 5s or less also works.

Is there anything we can do per-request?

Requiring server changes for a middleware is a bit annoying.

Maybe we should just make the default heartbeat 4 seconds instead?

Yeah, perhaps a lower default and a print a warning if the heartbeat is lower than keepAliveTimeout?

I just started encountering the same issue after upgrading to Node 8.

@brudil thanks for the fix, setting the server's keepAliveTimeout to 0 resolved the issue for me.

Seems to work fine on node 8.1.1

I can confirm it's working with node 8.1.1 as well

Also confirmed! 馃拑

Just gotta update to 8.1.1 and it's golden.

Anyone know what changed in core to fix this for us?

Anyone know what changed in core to fix this for us?

@glenjamin it's both https://github.com/nodejs/node/issues/13435 + https://github.com/nodejs/node/issues/13391 and the one @brudil pointed out in his reply its https://github.com/nodejs/node/pull/2534. They're all pointing to the same issue.

Cheers for the link, read through those and it looks like https://github.com/nodejs/node/pull/13549 was the fix.

Gonna call this issue closed

upgrade node to latest version(9.0.0):

node -v
sudo npm cache clean -f
sudo n stable
node -v

also fixed for me.

The problem has been solved. thx

Was this page helpful?
0 / 5 - 0 ratings

Related issues

erikakers picture erikakers  路  11Comments

DmitryVolkovTulaco picture DmitryVolkovTulaco  路  4Comments

benjarwar picture benjarwar  路  10Comments

Javison666 picture Javison666  路  7Comments

sarincasm picture sarincasm  路  6Comments