[PPR] TypeError: Response.clone: Body has already been consumed. #69635
-
Testing out PPR and PFPR and it seems to be working well for the most part (nice work). However, in one of my routes I am seeing a 500 for the prefetch RSC GET request. Clicking a Link to those pages causes a full page load, but it does ultimately load the content.
I'm not opening an Issue yet as I don't have a clear way to reproduce (I don't know what's different about this page from others that are working). Happy to help investigate this if you can give me some pointers on what to try / where to look. Also happy to share a Vercel preview build URL / create a Replay, if that's helpful. |
Beta Was this translation helpful? Give feedback.
Replies: 39 comments 53 replies
-
Fixed in #70082 🎉 |
Beta Was this translation helpful? Give feedback.
-
Appears this error is now in all our Vercel deployments. Happened overnight with no changes to git. |
Beta Was this translation helpful? Give feedback.
-
I am using Vercel but I would love to stick to node v20 somehow; can I pin the version on v20.16 somehow? {
"engines": {
"node": "20.16"
}
} Would that work in |
Beta Was this translation helpful? Give feedback.
-
As a workaround in our situation we just added updated undici to package.json devDependencies and this solved the issue for the moment |
Beta Was this translation helpful? Give feedback.
-
This is still happening to me even after upgrading to NextJS v15.02 and adding undici v6.20.1 to devDependencies. |
Beta Was this translation helpful? Give feedback.
-
This is happening to me on my production application. Next 14.2.17 deployed via SST v3. Unfortunately SST v3 seems to only allow configuring Nextjs sites to Node v20, but manually going to the AWS console and downgrading the site default function to Node 18 seems to clear the problem up, however subsequent deployments appear to override the manual change.
Preferably Next 14 is updated to not have this error occur. |
Beta Was this translation helpful? Give feedback.
-
Happening to me (self hosted with docker) with NextJS 14.2.17 and node:20-alpine, also tried node:18-alpine and same happens. |
Beta Was this translation helpful? Give feedback.
-
This is happening to me on my production application. Next 14.2.17 deployed via Vercel. Localhost works fine... |
Beta Was this translation helpful? Give feedback.
-
It's impossible for me to reproduce the issue on local, i'm using the same nodejs version that is used on Vercel; And the configuration for the middleware is literally copy/pasted from supabase (most of the time i get the clone body error, as supabase is not able to read the information). (Running on Node.js version: v20.18.0) -> Works perfect on localhost, but not in production. Strangely enough, the error is easy to reproduce in production, when i deploy a new version (just changing the readme, it will trigger it) after a while the error rate drastically reduce; However you can imagine how happy are my customers seeing random errors pages. Some of the errors so that can google can index it and brings more people to this page:
#Update 9 Nov - 2:36AM
|
Beta Was this translation helpful? Give feedback.
-
👋 hello, I am a bit confused as to what the resolution was. I have a customer running on app router Has this been resolved in 15, can somebody please help clarify? Thank you so much! |
Beta Was this translation helpful? Give feedback.
-
@steve-marmalade Yeah I see the fix was merged to canary. We are not quite ready to update 15 yet though, much less canary. Is there any chance we can get this fix back-ported to a nextjs 14+ security patch like they did for those issues fixed in 14.2.17? |
Beta Was this translation helpful? Give feedback.
-
this needs to be reopened, it still happens |
Beta Was this translation helpful? Give feedback.
-
I am still having the same issue, and I can't downgrade to Node 18 because I am using the |
Beta Was this translation helpful? Give feedback.
-
Yeah we're running into this as well a bunch. I think its an underlying call to supabase which is failing, which is resulting in middleware saying there's no user and redirecting them to login page. Really annoying. |
Beta Was this translation helpful? Give feedback.
-
Happening for me on NextJS 15 without (AFAIK) failed calls. Revert to Node 18 resolved. |
Beta Was this translation helpful? Give feedback.
-
Hoping we can get some attention directed to this. This is not a resolved conversation. |
Beta Was this translation helpful? Give feedback.
-
We have a Vercel partnership at work, and I had a chat with support. They suggest to set the following environment variable on Vercel.
It seems to resolve the issue for us using Using that environment variable will use a different Undici version then Node uses. But I'm afraid this is only really a solution if you are hosting on Vercel. |
Beta Was this translation helpful? Give feedback.
-
We're not hosting on Vercel. We only saw this issue appear after we upgraded from Node 20.16 to 20.18.1. The timing of the initial comment in this thread coincides with (or slightly after) the release of Node 20.17. Is it possible a regression was introduced there, rather than in Next? Or an interaction between the two? I'd be curious to see someone else downgrade Node to 20.16 and see if the issue persists. |
Beta Was this translation helpful? Give feedback.
-
#73274 is in draft and fixes this issue. |
Beta Was this translation helpful? Give feedback.
-
Resolved in #73274. Accessible in Next.js 14.2.20 and 15.0.4-canary.40+ |
Beta Was this translation helpful? Give feedback.
-
Any references to the actual bug in |
Beta Was this translation helpful? Give feedback.
-
Error still persists even after upgrade for 14.2.20. We are using Vercel for deployment.
|
Beta Was this translation helpful? Give feedback.
-
TypeError: Response.clone: Body has already been consumed.
|
Beta Was this translation helpful? Give feedback.
-
Error still present in
We cannot reproduce it consistently, but the issue is definitely there. Some people say it’s easier to reproduce when multiple tabs are open. I encounter the error occasionally, but I haven’t found a way to reproduce it reliably. Any suggestions to find out the source? |
Beta Was this translation helpful? Give feedback.
-
I'm assuming this issue is not fixed if you're on next 14 with node 22.x? as I have encountered this in the vercel build logs and locally. |
Beta Was this translation helpful? Give feedback.
-
Still not fixed I got the issue on 14.2.5 |
Beta Was this translation helpful? Give feedback.
-
Still not fixed. I got the issue on v14.2.25 with Node.js v22 runtime on Vercel. Downgrade to Node.js v18 fixed the issue. I use parallel routes and some of the routes have the same fetch function. |
Beta Was this translation helpful? Give feedback.
-
We still have the issue on v14.2.24. It started when we upgraded to Node.js v22. I couldn't find any discussions on this topic neither on Node.js nor undici. |
Beta Was this translation helpful? Give feedback.
-
Hello, I'm also encountering this issue on v14.2.24 (Node.js v20). The bug appears randomly on several API routes on our app, it's really difficult to isolate. |
Beta Was this translation helpful? Give feedback.
-
Any updates on this? I’m still encountering this issue on Next.js v14.2.30 with Node.js v20.19.4. I read it should work with Node v20.17, but I can’t downgrade for security reasons. I’m planning to upgrade to Next v15 and Node v22 to try and resolve the issue, but I’m not sure if that will work. I could use some confirmation or advice. The bug appears on a certain API route on the website |
Beta Was this translation helpful? Give feedback.
Resolved in #73274. Accessible in Next.js 14.2.20 and 15.0.4-canary.40+