Next.js Discord

Discord Forum

How do I exit NextJS with a SIGTERM signal?

Irish Red and White Setter posted this in #help-forum
Open in Discord
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

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

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