next.js icon indicating copy to clipboard operation
next.js copied to clipboard

Next dev server is not closing when direct terminal close

Open thetejasmagade opened this issue 1 year ago • 2 comments

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.

  1. start the application dev server npm run dev
  2. close the terminal without closing dev server
  3. 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

thetejasmagade avatar Jan 28 '24 13:01 thetejasmagade

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!!

itssubhodiproy avatar Jan 28 '24 14:01 itssubhodiproy

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!!

DeyvidJesus avatar Jan 30 '24 13:01 DeyvidJesus

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.

balazsorban44 avatar Feb 27 '24 22:02 balazsorban44

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.

github-actions[bot] avatar Mar 13 '24 00:03 github-actions[bot]