From a24872b4ab692137ecb815062ff15b3c2b4f9667 Mon Sep 17 00:00:00 2001 From: Shu Ding Date: Thu, 8 Sep 2022 21:09:33 +0200 Subject: [PATCH] Fix flight manifest to include all chunks (#40365) When a client module is imported by both a module from an `app` entry and a module from `pages` entry, it is possible that it is included in the `pages` chunk eventually. The current check makes the manifest incomplete in that case. ## Bug - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Errors have helpful link attached, see `contributing.md` ## Feature - [ ] Implements an existing feature request or RFC. Make sure the feature request has been accepted for implementation before opening a PR. - [ ] Related issues linked using `fixes #number` - [ ] Integration tests added - [ ] Documentation added - [ ] Telemetry added. In case of a feature if it's used or not. - [ ] Errors have helpful link attached, see `contributing.md` ## Documentation / Examples - [ ] Make sure the linting passes by running `pnpm lint` - [ ] The examples guidelines are followed from [our contributing doc](https://github.com/vercel/next.js/blob/canary/contributing.md#adding-examples) --- .../next/build/webpack/plugins/flight-manifest-plugin.ts | 6 ------ 1 file changed, 6 deletions(-) diff --git a/packages/next/build/webpack/plugins/flight-manifest-plugin.ts b/packages/next/build/webpack/plugins/flight-manifest-plugin.ts index d300c27d7209..a7c32f98293f 100644 --- a/packages/next/build/webpack/plugins/flight-manifest-plugin.ts +++ b/packages/next/build/webpack/plugins/flight-manifest-plugin.ts @@ -121,12 +121,6 @@ export class FlightManifestPlugin { id: ModuleId, mod: webpack.NormalModule ) { - // if appDir is enabled we shouldn't process chunks from - // the pages dir - if (chunk.name?.startsWith('pages/') && appDir) { - return - } - const isCSSModule = mod.type === 'css/mini-extract' || (mod.loaders &&