@@ -8,7 +8,7 @@ import type { ParsedNextUrl } from '../shared/lib/router/utils/parse-next-url'
8
8
import type { PrerenderManifest } from '../build'
9
9
import type { Rewrite } from '../lib/load-custom-routes'
10
10
import type { BaseNextRequest , BaseNextResponse } from './base-http'
11
- import type { ReadableStream } from 'next/dist/compiled/web-streams-polyfill/ponyfill'
11
+ import type { ReadableStream as ReadableStreamPolyfill } from 'next/dist/compiled/web-streams-polyfill/ponyfill'
12
12
import { TransformStream } from 'next/dist/compiled/web-streams-polyfill/ponyfill'
13
13
14
14
import { execOnce } from '../shared/lib/utils'
@@ -1273,7 +1273,7 @@ export default class NextNodeServer extends BaseServer {
1273
1273
} ,
1274
1274
url : url ,
1275
1275
page : page ,
1276
- body : currentBody ,
1276
+ body : currentBody as unknown as ReadableStream < Uint8Array > ,
1277
1277
} ,
1278
1278
useCache : ! this . nextConfig . experimental . runtime ,
1279
1279
onWarning : ( warning : Error ) => {
@@ -1352,7 +1352,7 @@ export default class NextNodeServer extends BaseServer {
1352
1352
*/
1353
1353
function requestToBodyStream (
1354
1354
request : IncomingMessage
1355
- ) : ReadableStream < Uint8Array > {
1355
+ ) : ReadableStreamPolyfill < Uint8Array > {
1356
1356
const transform = new TransformStream < Uint8Array , Uint8Array > ( {
1357
1357
start ( controller ) {
1358
1358
request . on ( 'data' , ( chunk ) => controller . enqueue ( chunk ) )
@@ -1368,8 +1368,8 @@ function requestToBodyStream(
1368
1368
* A simple utility to take an original stream and have
1369
1369
* an API to duplicate it without closing it or mutate any variables
1370
1370
*/
1371
- function teeableStream < T > ( originalStream : ReadableStream < T > ) : {
1372
- duplicate ( ) : ReadableStream < T >
1371
+ function teeableStream < T > ( originalStream : ReadableStreamPolyfill < T > ) : {
1372
+ duplicate ( ) : ReadableStreamPolyfill < T >
1373
1373
} {
1374
1374
return {
1375
1375
duplicate ( ) {
0 commit comments