-
Notifications
You must be signed in to change notification settings - Fork 30.4k
Labels
OutputRelated to the the output configuration option.Related to the the output configuration option.bugIssue was opened via the bug report template.Issue was opened via the bug report template.linear: nextConfirmed issue that is tracked by the Next.js team.Confirmed issue that is tracked by the Next.js team.locked
Description
Verify canary release
- I verified that the issue exists in the latest Next.js canary release
Provide environment information
Operating System:
Platform: darwin
Arch: arm64
Version: Darwin Kernel Version 22.5.0: Thu Jun 8 22:22:20 PDT 2023; root:xnu-8796.121.3~7/RELEASE_ARM64_T6000
Binaries:
Node: 20.3.1
npm: 9.6.7
Yarn: 1.22.18
pnpm: 7.29.3
Relevant Packages:
next: 13.4.13-canary.18
eslint-config-next: N/A
react: 18.2.0
react-dom: 18.2.0
typescript: 5.1.3
Next.js Config:
output: N/AWhich area(s) of Next.js are affected? (leave empty if unsure)
Standalone mode (output: "standalone")
Link to the code that reproduces this issue or a replay of the bug
https://github.com/Meemaw/next-server-shutdown-reproducer
To Reproduce
- yarn build
- yarn start
- Visit http://localhost:3000
- Close the server before the page renders
- Get a "This site can’t be reached" error
Describe the Bug
NextJS doesn't gracefully handle inflight HTTP server connections. There is a cleanup code
| const cleanup = () => { |
, but it doesn't call server.cleanup().
There also seems to be a teardown function defined
| async function teardown() { |
, which does the correct thing, but is never called?
Expected Behavior
server.cleanup() should be called & awaited so any inflight requests are gracefully handled.
Which browser are you using? (if relevant)
No response
How are you deploying your application? (if relevant)
No response
Metadata
Metadata
Assignees
Labels
OutputRelated to the the output configuration option.Related to the the output configuration option.bugIssue was opened via the bug report template.Issue was opened via the bug report template.linear: nextConfirmed issue that is tracked by the Next.js team.Confirmed issue that is tracked by the Next.js team.locked