diff --git a/packages/next/package.json b/packages/next/package.json index 01ee583406b571c..b392a740308b23c 100644 --- a/packages/next/package.json +++ b/packages/next/package.json @@ -73,8 +73,7 @@ "caniuse-lite": "^1.0.30001283", "postcss": "8.4.5", "styled-jsx": "5.0.0", - "use-subscription": "1.5.1", - "web-streams-polyfill": "3.0.3" + "use-subscription": "1.5.1" }, "peerDependencies": { "fibers": ">= 3.1.0", @@ -263,6 +262,7 @@ "uuid": "8.3.2", "vm-browserify": "1.1.2", "watchpack": "2.3.1", + "web-streams-polyfill": "3.0.3", "web-vitals": "2.1.0", "webpack-sources1": "npm:webpack-sources@1.4.3", "webpack-sources3": "npm:webpack-sources@3.2.3", diff --git a/packages/next/server/next-server.ts b/packages/next/server/next-server.ts index f610fe8d20a83dd..365299445175b3d 100644 --- a/packages/next/server/next-server.ts +++ b/packages/next/server/next-server.ts @@ -8,8 +8,8 @@ import type { ParsedNextUrl } from '../shared/lib/router/utils/parse-next-url' import type { PrerenderManifest } from '../build' import type { Rewrite } from '../lib/load-custom-routes' import type { BaseNextRequest, BaseNextResponse } from './base-http' -import type { ReadableStream } from 'web-streams-polyfill/ponyfill' -import { TransformStream } from 'web-streams-polyfill/ponyfill' +import type { ReadableStream } from 'next/dist/compiled/web-streams-polyfill/ponyfill' +import { TransformStream } from 'next/dist/compiled/web-streams-polyfill/ponyfill' import { execOnce } from '../shared/lib/utils' import { diff --git a/packages/next/server/web/types.ts b/packages/next/server/web/types.ts index c1d38bea9842246..a8315e74e5dc6f1 100644 --- a/packages/next/server/web/types.ts +++ b/packages/next/server/web/types.ts @@ -1,5 +1,5 @@ import type { I18NConfig } from '../config-shared' -import type { ReadableStream } from 'web-streams-polyfill/ponyfill' +import type { ReadableStream } from 'next/dist/compiled/web-streams-polyfill/ponyfill' import type { NextRequest } from '../web/spec-extension/request' import type { NextFetchEvent } from '../web/spec-extension/fetch-event' import type { NextResponse } from './spec-extension/response' diff --git a/packages/next/types/misc.d.ts b/packages/next/types/misc.d.ts index 555d3ad83d6e763..8f283c6606f1fa4 100644 --- a/packages/next/types/misc.d.ts +++ b/packages/next/types/misc.d.ts @@ -331,6 +331,11 @@ declare module 'next/dist/compiled/comment-json' { export = m } +declare module 'next/dist/compiled/web-streams-polyfill/ponyfill' { + import m from 'web-streams-polyfill/ponyfill' + export = m +} + declare module 'pnp-webpack-plugin' { import webpack from 'webpack4'