Skip to content

Commit

Permalink
transform stream
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxLeiter committed Jun 27, 2023
1 parent 4693323 commit 7e5326a
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions packages/next/src/server/node-polyfill-web-streams.ts
Expand Up @@ -11,7 +11,12 @@ if (!global.ReadableStream) {
}
}
if (!global.TransformStream) {
const { TransformStream } =
require('next/dist/compiled/@edge-runtime/ponyfill') as typeof import('next/dist/compiled/@edge-runtime/ponyfill')
global.TransformStream = TransformStream
// Same as ReadableStream above.
if (require('stream').TransformStream) {
global.TransformStream = require('stream').TransformStream
} else {
const { TransformStream } =
require('next/dist/compiled/@edge-runtime/ponyfill') as typeof import('next/dist/compiled/@edge-runtime/ponyfill')
global.TransformStream = TransformStream
}
}

0 comments on commit 7e5326a

Please sign in to comment.