From 826965354a4778af87362b1595cfd37514fc6225 Mon Sep 17 00:00:00 2001 From: Samuel Newman Date: Thu, 12 Feb 2026 15:38:31 +0200 Subject: [PATCH] hackfix webpack dev server freezing --- webpack.config.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/webpack.config.js b/webpack.config.js index b312a2d6c3..a759c9ce49 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -35,6 +35,15 @@ module.exports = async function (env, argv) { ] if (env.mode === 'development') { config.plugins.push(new ReactRefreshWebpackPlugin()) + // Reap zombie HMR WebSocket connections that linger after refresh. + // Without this, dead sockets exhaust the browser's per-origin connection + // pool and the dev server stops responding. + config.devServer.onListening = devServer => { + devServer.server.on('connection', socket => { + socket.setTimeout(10000) + socket.on('timeout', () => socket.destroy()) + }) + } } else { // Support static CDN for chunks config.output.publicPath = 'auto'