From f3b61f3a50592affc1ac4acfd10a7f566a965946 Mon Sep 17 00:00:00 2001 From: Gal Schlezinger Date: Mon, 14 Feb 2022 15:54:41 +0200 Subject: [PATCH] Use the locally compiled version of `web-streams-polyfill` --- packages/next/package.json | 4 ++-- packages/next/server/next-server.ts | 4 ++-- packages/next/server/web/types.ts | 2 +- packages/next/types/misc.d.ts | 5 +++++ 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/packages/next/package.json b/packages/next/package.json index 01ee583406b571..b392a740308b23 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 f610fe8d20a83d..365299445175b3 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 c1d38bea984224..a8315e74e5dc6f 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 555d3ad83d6e76..8f283c6606f1fa 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'