-
-
Notifications
You must be signed in to change notification settings - Fork 636
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
CTRL + C not killing webpack dev server in Windows cousing port 8080 to be locked #2562
Comments
Will this option from execa help? https://github.com/sindresorhus/execa#cleanup Maybe you have will have to try it yourself and help with a patch (Don't have windows with me) :) |
Tried those options: this.execaOptions = {
preferLocal: true,
buffer: false,
stdio: 'pipe',
localDir: this.projectRoot,
cwd: this.projectRoot,
cleanup: true, // Added
detatched: false, // Added
env: {
FORCE_COLOR: 'true',
...this.env,
},
}; But it had no affect. Still same :| |
Found such interesting thing: https://github.com/sindresorhus/execa#windowshide Modified the settings object: this.execaOptions = {
preferLocal: true,
buffer: false,
stdio: 'pipe',
localDir: this.projectRoot,
cwd: this.projectRoot,
windowsHide: false, // Added
env: {
FORCE_COLOR: 'true',
...this.env,
},
}; And it works all good now in Windows. Going to test out Linux too There's also some interesting discussion about why they haven't switched default valu to In short: Can't set that option to |
Tested on: Setting |
…C in Windows Killing server with CTRL-C in dev mode in Windows leaves webpack-dev-server running on port 8080 and never releases it fix adonisjs/core#2562
Would be cool if someone can test it with Mac |
…C in Windows (#26) Killing server with CTRL-C in dev mode in Windows leaves webpack-dev-server running on port 8080 and never releases it fix adonisjs/core#2562
Package version
AdonisJS V5
package.json
Node.js and npm version
node -v
v14.16.1
npm --version
6.14.12
Sample Code (to reproduce the issue)
node ace serve --watch
node ace serve --watch
Project setup
Outcome of starting server, closing it and starting it again
Expected outcome
CTRL + C
should kill both, server and Webpack dev serverActual outcome
Webpack dev server is not dying and has to be killed by
PID
otherwise port 8080 will be forever taken by proccess running in backgroundBONUS (a sample repo to reproduce the issue)
It happens with fresh project
Seems like it's issue in @adonis/assembler
If saving child proccess to AssetBundler instance in here:
https://github.com/adonisjs/assembler/blob/develop/src/AssetsBundler/index.ts#L106
this.webpackDevServerInstance = childProcess
And when storing
encore
tothis.encore
inhttps://github.com/adonisjs/assembler/blob/develop/src/DevServer/index.ts#L201
Then should be able to kill it somewhere in here:
https://github.com/adonisjs/assembler/blob/develop/src/DevServer/index.ts#L188
But seems like none of the events run when killing with CTRL + C
Might be related to #2273 (comment)
It's most likely in wrong repo, but couldn't figure out to which repo to put it. Feel free to move to right place
The text was updated successfully, but these errors were encountered: