[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: 32 comments 44 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.
-
This should really be re-openend since the solution that is marked is not the general solution for everyone on next 14. |
Beta Was this translation helpful? Give feedback.
-
Also encounter the following error randomly: |
Beta Was this translation helpful? Give feedback.
-
I am still having the same issue. I'm using node 18 and nextjs v14.2.11 and I'd like to solve this issue without downgrading to node 18. |
Beta Was this translation helpful? Give feedback.
-
This is still happening on v14.2.18 - is there any update on this? Still getting: Fully blocking on next 14 / adopting app directory or deploying anything to production... |
Beta Was this translation helpful? Give feedback.
-
Same issue on 14.2.8, downgrading to node 18 works. |
Beta Was this translation helpful? Give feedback.
-
Agreed that this should still be open - was experiencing this in next15 and dropped back to next14. Still experiencing it in both. Switching the node version to node 18 in vercel fixed it for me. |
Beta Was this translation helpful? Give feedback.
-
I was using node20-alpine and nextjs v14.2.15, This error occurs on production already 55 times for last 7 days. It's insane, can you guys have a look on it with priority? thanks in advance |
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.
Resolved in #73274. Accessible in Next.js 14.2.20 and 15.0.4-canary.40+