vercel / vercel/next.js

Docs: App Router docs for gracefully handling shutdowns still requires pages/_document.js

Open
#51,404 20 comments 23 reactions 1 assignee View on GitHub

@icyJoseph is already working on this.

Since Feb 2, 2026.

Dominant language
JavaScript
Stars
142k
Forks
32.4k
Avg merge
2d 14h
Merged PRs (30d)
351

Description

What is the improvement or update you wish to see?

The docs for NextJS using the App Router for Manual graceful shutdowns use the pages/_document.js file to handle shutdown signals, though my project doesn't even have a pages/ directory anymore now that everything is moved over to App Router.

The migration docs from the Pages to App Router even has a section on getting rid of the _document.js file, so I would assume this is not supposed to be the way moving forward. Am I wrong?

Is it still the "proper" way to handle this, or is there some other App Router-native method of handling shutdown signals? Thanks!

Is there any context that might help us understand?

I posted a discussion about this but figured that this might be a useful docs improvement (or maybe a missing piece of functionality with the App Router).

Does the docs page already exist? Please link to it.

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

DX-1692

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.