Aborting a fetch call to an app router API endpoint does not abort the request when streaming under Vercel's Node Runtime #77786
Labels
Connection
Related to the connection() function.
linear: next
Confirmed issue that is tracked by the Next.js team.
Uh oh!
There was an error while loading. Please reload this page.
Link to the code that reproduces this issue
https://github.com/acrognale/vercel-next-abort-repro
To Reproduce
I've included a standard Next app in the repository that you can start with
npm run dev
.Current vs. Expected behavior
When running locally, the request properly aborts. Here is the expected server output:
and on the frontend:
But when running on Vercel under the Node Runtime, we receive the following:
server:
(and then the function times out because the max duration is 10s.
On the frontend:
So while the browser is canceling the request, the function on the Node Runtime continues to stream.
Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 24.1.0: Thu Oct 10 21:06:57 PDT 2024; root:xnu-11215.41.3~3/RELEASE_ARM64_T6041 Available memory (MB): 36864 Available CPU cores: 14 Binaries: Node: 22.14.0 npm: 10.9.2 Yarn: 1.22.22 pnpm: 10.6.5 Relevant Packages: next: 15.2.4 // Latest available version is detected (15.2.4). eslint-config-next: N/A react: 19.1.0 react-dom: 19.1.0 typescript: 5.8.2 Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
Connection
Which stage(s) are affected? (Select all that apply)
Vercel (Deployed)
Additional context
No response
NEXT-4352
The text was updated successfully, but these errors were encountered: