Do you want to request a feature or report a bug?
bug report
What is the current behavior?
I am running webpack-dev-server command to serve up a simple app. I'm launching it via Git Bash on Windows (not sure if this is relevant). When I press Ctrl-C to stop it, and relaunch it, I get the following:
> webpack-dev-server --colors
events.js:182
throw er; // Unhandled 'error' event
^
Error: listen EADDRINUSE 127.0.0.1:9000
at Object._errnoException (util.js:1022:11)
at _exceptionWithHostPort (util.js:1045:20)
at Server.setupListenHandle [as _listen2] (net.js:1330:14)
at listenInCluster (net.js:1378:12)
at GetAddrInfoReqWrap.doListen [as callback] (net.js:1504:7)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:100:10)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: `webpack-dev-server --colors`
npm ERR! Exit status 1
npm ERR!
If the current behavior is a bug, please provide the steps to reproduce.
(Willing to concede it might be related to git bash/windows signals?)
What is the expected behavior?
The second process should launch normally
Please mention your webpack and Operating System version.
webpack: 2.6.1
webpack-dev-server: 2.7.1
Windows 10 Home (Version 1703)
Chalking this up to an edge case with bash on Windows. It definitely doesn't happen in bash proper. Would be happy to review a pull request if you'd like to submit one.
Im particularly suspicious of Git Bash (Msys2 terminal) itself, since I started seeing this behavior ever since upgrading git to 2.14.1 a few days ago.
Same here with 2.14.1. Probably related to https://github.com/git-for-windows/git/issues/1248
I don't have a windows machine available to debug this, so we're going to have to rely on someone in the community to debug why SIGINT doesn't work in that environment. We'll leave this one open for a while in the hopes that someone steps up.
We're going to close this one citing lack of activity and https://github.com/git-for-windows/git/issues/1248. Please do ping me if someone discovers info that webpack-dev-server is doing something wrong with capturing SIGINT on that particular platform and app.
I'm still facing this issue with webpack-dev-server version 2.9.7 using Git Bash for Windows (which caused another issue and wasted my time). But it works fine with CMD.
Recently nodemon fixed a similar issue by using fork instead of spawn. I'm not sure if this issue can be solved using the same method.
Most helpful comment
I'm still facing this issue with webpack-dev-server version 2.9.7 using Git Bash for Windows (which caused another issue and wasted my time). But it works fine with CMD.
Recently nodemon fixed a similar issue by using
forkinstead ofspawn. I'm not sure if this issue can be solved using the same method.