response.body?.cancel()
of fetch
causes unexpected behaviors in App Router
#72389
Labels
bug
Issue was opened via the bug report template.
Link to the code that reproduces this issue
https://codesandbox.io/p/devbox/lucid-cohen-8r5tyq?workspaceId=cf95a29a-9e60-48fa-8cf5-0d217db0d3c6
To Reproduce
npm run build && npm run start
)/
Current vs. Expected behavior
Expected:
ReadableStream
(response.body
) is successfully cancelled.Current:
response.body?.cancel()
does not resolve, causing the page to not return.response.body?.cancel()
is called, the Next.js server does not terminate whenCtrl + C
is pressed in the terminal.Provide environment information
Operating System: Platform: linux Arch: x64 Version: #1 SMP Fri Mar 29 23:14:13 UTC 2024 Available memory (MB): 39993 Available CPU cores: 20 Binaries: Node: 22.11.0 npm: 10.9.0 Yarn: 1.22.15 pnpm: 9.10.0 Relevant Packages: next: 15.0.2 // Latest available version is detected (15.0.2). eslint-config-next: 15.0.2 react: 19.0.0-rc-02c0e824-20241028 react-dom: 19.0.0-rc-02c0e824-20241028 typescript: 5.6.3 Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
Not sure
Which stage(s) are affected? (Select all that apply)
next start (local), Other (Deployed)
Additional context
Reproduced with not only Next.js v15.0.2 but also v14.2.17 at least.
I know the way to get only header or consume body in other way. This issue focuses on the bug with
response.body.cancel
.The text was updated successfully, but these errors were encountered: