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

The server never closes, even after ^C and closing the terminal #1489

Closed
1 of 2 tasks
nebrelbug opened this issue Sep 5, 2018 · 10 comments
Closed
1 of 2 tasks

The server never closes, even after ^C and closing the terminal #1489

nebrelbug opened this issue Sep 5, 2018 · 10 comments

Comments

@nebrelbug
Copy link

  • Operating System: Windows 10
  • Node Version: 8.9.0
  • NPM Version: 6.3.0
  • webpack Version: 4.17.1
  • webpack-dev-server Version: 3.1.7
  • This is a bug
  • This is a modification request

Code

  // webpack.config.js
  ...
 devServer: {
    contentBase: path.join(__dirname, '')
 },

Expected Behavior

When I press ^C, the server stops

Actual Behavior

The server keeps on running! I'm on Git Bash, and even when I close the terminal, the server is still running. I ran it on localhost:9000, localhost:9003, and localhost:8081, and I can access the server on all 3 of them, even though I tried to end localhost:9000 and localhost:9003

For Bugs; How can we reproduce the behavior?

Try and close the server in Git Bash

For Features; What is the motivation and/or use-case for the feature?

@alexander-akait
Copy link
Member

@nebrelbug do you use webpack-dev-server or webpack-serve?

@nebrelbug
Copy link
Author

@evilebottnawi I use webpack-dev-server

@alexander-akait
Copy link
Member

@nebrelbug please create minimum reproducible test repo, thanks

@nebrelbug
Copy link
Author

I think it would work on any repo with Git Bash, probably

@aprilmintacpineda
Copy link

aprilmintacpineda commented Nov 12, 2018

I'm experiencing this same error, but in my case the process exits after a while after ctrl+c.

This is the output I get after CTRL+C:

image

I know that the dev-server is still running because when I run the server again, it would complain that the port is already occupied and I have to manually kill that process.

This is how I run the dev server: babel-node node_modules/.bin/webpack-dev-server --config webpack/start.js

@alexander-akait
Copy link
Member

@aprilmintacpineda Looks problem in babel-node here

@aprilmintacpineda
Copy link

I see, after doing only webpack-dev-server --config webpack/start.js it exited with no error. But then would need to refactor my codes for the build script to work without babel-node. Any suggestion?

@alexander-akait
Copy link
Member

@aprilmintacpineda better create issue in babel-node, we just listen process on CTRL+C and looks babel don't pass this to webpack-dev-server process

@ninofiliu
Copy link

I've got more or less the same behavior:

  1. webpack-dev-server --open
  2. Everything works fine when dev-serving the project
  3. Hit Ctrl+C
  4. localhost:8080 doesn't serve anything anymore, however the node task launched by the dev server is still running (30% of the CPU power + ~400MB of RAM)

OS: Windows
Config: HMR enabled

@alexander-akait
Copy link
Member

Close in favor #1479 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants