From e0bee9c48b5919ce0df4fcf04f795b2c583d4038 Mon Sep 17 00:00:00 2001 From: Jiachi Liu Date: Wed, 26 Oct 2022 15:04:10 -0700 Subject: [PATCH] fix build --- packages/next/build/index.ts | 4 ++-- .../next/build/webpack/plugins/flight-client-entry-plugin.ts | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/next/build/index.ts b/packages/next/build/index.ts index 0896b18814ca4..46d7e0294b322 100644 --- a/packages/next/build/index.ts +++ b/packages/next/build/index.ts @@ -60,7 +60,7 @@ import { RSC_MODULE_TYPES, FONT_LOADER_MANIFEST, CLIENT_STATIC_FILES_RUNTIME_MAIN_APP, - APP_INTERNALS, + APP_CLIENT_INTERNALS, } from '../shared/lib/constants' import { getSortedRoutes, isDynamicRoute } from '../shared/lib/router/utils' import { __ApiPreviewProps } from '../server/api-utils' @@ -978,7 +978,7 @@ export default async function build( if (!serverResult.errors.length && !edgeServerResult?.errors.length) { injectedClientEntries.forEach((value, key) => { const clientEntry = clientConfig.entry as webpack.EntryObject - if (key === APP_INTERNALS) { + if (key === APP_CLIENT_INTERNALS) { clientEntry[CLIENT_STATIC_FILES_RUNTIME_MAIN_APP] = [ // TODO-APP: cast clientEntry[CLIENT_STATIC_FILES_RUNTIME_MAIN_APP] to type EntryDescription once it's available from webpack // @ts-ignore clientEntry['main-app'] is type EntryDescription { import: ... } diff --git a/packages/next/build/webpack/plugins/flight-client-entry-plugin.ts b/packages/next/build/webpack/plugins/flight-client-entry-plugin.ts index 5b33cbf1945f2..9865fc21bdf06 100644 --- a/packages/next/build/webpack/plugins/flight-client-entry-plugin.ts +++ b/packages/next/build/webpack/plugins/flight-client-entry-plugin.ts @@ -1,7 +1,6 @@ import { stringify } from 'querystring' import path from 'path' import { webpack, sources } from 'next/dist/compiled/webpack/webpack' -import type { Dependency, EntryOptions } from 'webpack' import { getInvalidator, entries, @@ -519,8 +518,8 @@ export class FlightClientEntryPlugin { addEntry( compilation: any, context: string, - dependency: Dependency, - options: EntryOptions + dependency: any /* Dependency */, + options: any /* EntryOptions */ ): Promise /* Promise */ { return new Promise((resolve, reject) => { const entry = compilation.entries.get(options.name)