Next.js Discord

Discord Forum

How do I exit NextJS with a SIGTERM signal?

Unanswered
Irish Red and White Setter posted this in #help-forum
Open in Discord
Avatar
Irish Red and White SetterOP
Running npm run dev or npx next dev starts the dev server. Sending a SIGTERM to this process does not invoke any exiting procedure - it can't shut down gracefully. Is there any way to exit it gracefully?

2 Replies

Avatar
Highlander
I’m wondering this too. There’s docs for graceful shutdown for Pages Router, but this seems to be missing for App Router

https://nextjs.org/docs/pages/building-your-application/deploying#manual-graceful-shutdowns

@Irish Red and White Setter You managed to figure this one out?
Avatar
SIGINT is probably one of the only ways to gracefully shutdown the server i think