Skip to content

Commit

Permalink
docs: Add notes about NEXT_MANUAL_SIG_HANDLE (#43686)
Browse files Browse the repository at this point in the history
It seems that setting `NEXT_MANUAL_SIG_HANDLE` in `.env` file is not working, so I added some notes.

## Documentation / Examples

- [ ] Make sure the linting passes by running `pnpm build && pnpm lint`
- [ ] The "examples guidelines" are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing/examples/adding-examples.md)
  • Loading branch information
soonoo committed Dec 4, 2022
1 parent 324de6b commit 0bd3422
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion docs/deployment.md
Expand Up @@ -136,7 +136,18 @@ Next.js will automatically load the latest version of your application in the ba

Sometimes you might want to run some cleanup code on process signals like `SIGTERM` or `SIGINT`.

You can do that by setting the env variable `NEXT_MANUAL_SIG_HANDLE` to `true` and then register a handler for that signal inside your `_document.js` file.
You can do that by setting the env variable `NEXT_MANUAL_SIG_HANDLE` to `true` and then register a handler for that signal inside your `_document.js` file. Please note that you need to register env variable directly in the system env variable, not in the `.env` file.

```json
// package.json
{
"scripts": {
"dev": "NEXT_MANUAL_SIG_HANDLE=true next dev",
"build": "next build",
"start": "NEXT_MANUAL_SIG_HANDLE=true next start"
}
}
```

```js
// pages/_document.js
Expand Down

0 comments on commit 0bd3422

Please sign in to comment.