Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow using webpack-hot-middleware as middleware #67

Open
nickrttn opened this issue Sep 20, 2023 · 0 comments
Open

Allow using webpack-hot-middleware as middleware #67

nickrttn opened this issue Sep 20, 2023 · 0 comments
Labels
enhancement New feature or request

Comments

@nickrttn
Copy link

nickrttn commented Sep 20, 2023

Currently, when attempting to use webpack-hot-middleware as EleventyDevServer middleware, webpack-hot-middleware's browser client cannot connect to the endpoint exposed by webpack-hot-middleware, for whatever reason.

From what I've been able to figure out myself, webpack-hot-middleware attempts to send headers to the client, but these never arrive, from here: https://github.com/webpack-contrib/webpack-hot-middleware/blob/master/middleware.js#L100

webpack-dev-middleware is working, as the bundled scripts are being served from memory.

I've created a reduced test case where you can see the behavior occur. It would be great if this use case would be supported, so Webpack can be integrated directly into 11ty dev server and there is no need for orchestrating several running processes.

Please see the reproduction here: https://github.com/nickrttn/11ty-webpack, to reproduce:

git clone https://github.com/nickrttn/11ty-webpack
cd 11ty-webpack
npm install
npm run start

Then open http://localhost:8080, and see that /__webpack_hmr cannot be connected to (times out after 20s) and does not receive headers or body content.

@zachleat zachleat added the enhancement New feature or request label Apr 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants