webpack-hot-middleware icon indicating copy to clipboard operation
webpack-hot-middleware copied to clipboard

Opening 5+ tabs causes Express to hang indefinitely

Open jmikrut opened this issue 3 years ago • 2 comments

  • Operating System: Mac OS Monterey 12.4
  • Node Version: 14.18.1
  • NPM Version: 6.14.15
  • webpack Version: 5.6.0
  • ${package} Version: 2.25.1

Expected Behavior

I should be able to open many tabs and not cause my Express server to indefinitely hang.

Actual Behavior

Right now, opening more than 5 tabs with webpack-hot-middleware causes Express, and all subsequent requests, to hang indefinitely. The problem is caused by webpack-hot-middleware specifically, as removing it and relying solely on webpack-dev-middleware does not present the same issue.

There is a video demonstrating the behavior within the Payload CMS repo: https://github.com/payloadcms/payload/issues/824

Code

  const compiler = webpack(webpackDevConfig);

  router.use(webpackDevMiddleware(compiler, {
    publicPath: webpackDevConfig.output.publicPath as string,
  }));

  router.use(webpackHotMiddleware(compiler));

How Do We Reproduce?

Simply try to open more than 5 tabs at once with webpack-hot-middleware running.

jmikrut avatar Jul 26 '22 01:07 jmikrut

@jmikrut hm, intresting, can you provide small repo, because I think there is not problem webpack-hot-middleware here, because we don;t have logic around tabs

alexander-akait avatar Nov 07 '22 20:11 alexander-akait

Hey @alexander-akait i don’t believe it is an issue with our tabs field at all. No interaction with on-page JS is necessary to recreate the issue. It happens regardless of what is loaded on the page.

jmikrut avatar Nov 07 '22 21:11 jmikrut