diff --git a/packages/next/server/body-streams.ts b/packages/next/server/body-streams.ts index 7218529a660a4..1926b9357c589 100644 --- a/packages/next/server/body-streams.ts +++ b/packages/next/server/body-streams.ts @@ -90,8 +90,14 @@ export function getClonableBody( const input = buffered ?? readable const p1 = new PassThrough() const p2 = new PassThrough() - input.pipe(p1) - input.pipe(p2) + input.on('data', (chunk) => { + p1.push(chunk) + p2.push(chunk) + }) + input.on('end', () => { + p1.push(null) + p2.push(null) + }) buffered = p2 return p1 },