From fac79be681f9c03efbcd0bbc21abf362e1645ea1 Mon Sep 17 00:00:00 2001 From: Jiachi Liu Date: Wed, 9 Nov 2022 16:18:01 +0100 Subject: [PATCH] fix layer detection --- .../build/webpack/plugins/flight-client-entry-plugin.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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 2ddbcb163343473..2df42a8d9053362 100644 --- a/packages/next/build/webpack/plugins/flight-client-entry-plugin.ts +++ b/packages/next/build/webpack/plugins/flight-client-entry-plugin.ts @@ -85,13 +85,11 @@ export class FlightClientEntryPlugin { const recordModule = (modId: string, mod: any) => { const modResource = mod.resourceResolveData?.path || mod.resource - if ( - mod.resourceResolveData?.context?.issuerLayer !== - WEBPACK_LAYERS.client - ) { + if (mod.layer !== WEBPACK_LAYERS.client) { return } + // Check mod resource to exclude the empty resource module like virtual module created by next-flight-client-entry-loader if (typeof modId !== 'undefined' && modResource) { // Note that this isn't that reliable as webpack is still possible to assign // additional queries to make sure there's no conflict even using the `named`