Skip to content

Commit ba6a706

Browse files
authored
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 e755e77 commit ba6a706

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
@@ -626,11 +626,11 @@ export class FlightClientEntryPlugin {
626626
const isCSS = isCSSMod(mod)
627627

628628
const modPath: string = mod.resourceResolveData?.path || ''
629+
const modQuery = mod.resourceResolveData?.query || ''
629630
// We have to always use the resolved request here to make sure the
630631
// server and client are using the same module path (required by RSC), as
631632
// the server compiler and client compiler have different resolve configs.
632-
let modRequest: string | undefined =
633-
modPath + mod.resourceResolveData?.query
633+
let modRequest: string = modPath + modQuery
634634

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

0 commit comments

Comments
 (0)