Next dev server is not closing when direct terminal close
Link to the code that reproduces this issue
https://codesandbox.io/p/devbox/github/vercel/next.js/tree/canary/examples/reproduction-template
To Reproduce
codesandbox link is provided because field is required, there is no need of it.
- start the application dev server npm run dev
- close the terminal without closing dev server
- now open new terminal and run dev server again
Current vs. Expected behavior
Should, close dev server when terminal closes.
Provide environment information
Operating System:
Platform: win32
Arch: x64
Version: Windows 11 Home Single Language
Binaries:
Node: 20.11.0
npm: N/A
Yarn: N/A
pnpm: N/A
Relevant Packages:
next: 14.1.0
eslint-config-next: 14.1.0
react: 18.0.0
react-dom: 18.0.0
typescript: 5.0.2
Next.js Config:
output: N/A
Which area(s) are affected? (Select all that apply)
CLI (create-next-app)
Which stage(s) are affected? (Select all that apply)
next dev (local)
Additional context
No response
Hey, I don't think this is an valid issue because closing and killing terminal are two different things. In order to close server for every nodejs environment you've to kill the terminal. And yes, this is intentional. I just tested with latest release. I've killed the terminal and server stopped as expected.
Thanks!!
I don't know whether it is a possibility or not, but I believe it would be a good idea to switch to Vite.js as soon as possible. In my opinion, it is way better than CRA, and it might solve the problems you're having.
Hope it helps!!
Closing as per: https://github.com/vercel/next.js/issues/61284#issuecomment-1913618431
If you think there is a bug where the process/terminal window hangs even after trying to close/kill, please open a new bug report with an attached reproduction, as that might be considered a bug. I cannot reproduce it, given the CodeSandbox example though.
This closed issue has been automatically locked because it had no new activity for 2 weeks. If you are running into a similar issue, please create a new issue with the steps to reproduce. Thank you.