Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
next.js
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Alex
next.js
Commits
25629bb8
Unverified
Commit
25629bb8
authored
Jun 27, 2023
by
Max Leiter
Committed by
GitHub
Jun 27, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
node-polyfill-web-streams: require from stream/web instead of stream (#51906)
Follow-up to #51901
parent
a3d3016d
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
node-polyfill-web-streams.ts
packages/next/src/server/node-polyfill-web-streams.ts
+4
-4
No files found.
packages/next/src/server/node-polyfill-web-streams.ts
View file @
25629bb8
...
@@ -2,8 +2,8 @@
...
@@ -2,8 +2,8 @@
if
(
!
global
.
ReadableStream
)
{
if
(
!
global
.
ReadableStream
)
{
// In Node v16, ReadableStream is available natively but under the `stream` namespace.
// In Node v16, ReadableStream is available natively but under the `stream` namespace.
// In Node v18+, it's available under global.
// In Node v18+, it's available under global.
if
(
require
(
'stream'
).
ReadableStream
)
{
if
(
require
(
'stream
/web
'
).
ReadableStream
)
{
global
.
ReadableStream
=
require
(
'stream'
).
ReadableStream
global
.
ReadableStream
=
require
(
'stream
/web
'
).
ReadableStream
}
else
{
}
else
{
const
{
ReadableStream
}
=
const
{
ReadableStream
}
=
require
(
'next/dist/compiled/@edge-runtime/ponyfill'
)
as
typeof
import
(
'next/dist/compiled/@edge-runtime/ponyfill'
)
require
(
'next/dist/compiled/@edge-runtime/ponyfill'
)
as
typeof
import
(
'next/dist/compiled/@edge-runtime/ponyfill'
)
...
@@ -12,8 +12,8 @@ if (!global.ReadableStream) {
...
@@ -12,8 +12,8 @@ if (!global.ReadableStream) {
}
}
if
(
!
global
.
TransformStream
)
{
if
(
!
global
.
TransformStream
)
{
// Same as ReadableStream above.
// Same as ReadableStream above.
if
(
require
(
'stream'
).
TransformStream
)
{
if
(
require
(
'stream
/web
'
).
TransformStream
)
{
global
.
TransformStream
=
require
(
'stream'
).
TransformStream
global
.
TransformStream
=
require
(
'stream
/web
'
).
TransformStream
}
else
{
}
else
{
const
{
TransformStream
}
=
const
{
TransformStream
}
=
require
(
'next/dist/compiled/@edge-runtime/ponyfill'
)
as
typeof
import
(
'next/dist/compiled/@edge-runtime/ponyfill'
)
require
(
'next/dist/compiled/@edge-runtime/ponyfill'
)
as
typeof
import
(
'next/dist/compiled/@edge-runtime/ponyfill'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment