webpack-hot-middleware
webpack-hot-middleware copied to clipboard
Middleware is preventing process from exiting
Process which uses this middleware is running until last connection is closed. This is happening even if I call close() on WebpackDevServer.
Something like this could help https://github.com/webpack/webpack-dev-server/blob/v2.1.0-beta.8/lib/Server.js#L386
Ah, good point - calling unref() on the SSE sockets would probably work too.
You mean adding req.socket.unref() somewhere here? https://github.com/glenjamin/webpack-hot-middleware/blob/master/middleware.js#L61
Because it does not help.
Yeah, that's what I meant - it should be enough.
Could you give https://github.com/mafintosh/why-is-node-running a go to see what it thinks is keeping the process up?
I am sorry but why-is-node-running is not working for me. I've noticed that when I sent ctrl + c to process, it hangs only if there is a tab in a browser navigated to this server. So it has to do something with sockets. When I remove this middleware it terminates as expected.
Can you try logging out
process._getActiveHandles()
// and
process._getActiveRequests()
At the point when you think the process should be shutting down cleanly?
Having the same problem you can use: https://github.com/myndzi/wtfnode
I think one culprit is req.socket. The sockets need to be closed to allow the process to exit.
Not 100% sure if you're experiencing the same issue but I did have a similar problem which was caused by a bug in chokidar