Skip to content

Commit 575385e

Browse files
huozhiztanner
authored andcommitted
Fix bad modRequest in flight entry manifest (#68888)
### What While going through the logic of flight manifest, found the `modRequest` sometimes accidentally become `"undefined"` string due to composing with another potential undefined value. This caused extra traversal, fixing this will improve a bit on the performance.
1 parent 9ecf2e8 commit 575385e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/next/src/build/webpack/plugins/flight-client-entry-plugin.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -644,11 +644,11 @@ export class FlightClientEntryPlugin {
644644
const isCSS = isCSSMod(mod)
645645

646646
const modPath: string = mod.resourceResolveData?.path || ''
647+
const modQuery = mod.resourceResolveData?.query || ''
647648
// We have to always use the resolved request here to make sure the
648649
// server and client are using the same module path (required by RSC), as
649650
// the server compiler and client compiler have different resolve configs.
650-
let modRequest: string | undefined =
651-
modPath + mod.resourceResolveData?.query
651+
let modRequest: string = modPath + modQuery
652652

653653
// Context modules don't have a resource path, we use the identifier instead.
654654
if (mod.constructor.name === 'ContextModule') {

0 commit comments

Comments
 (0)