Skip to content

Commit 768a50f

Browse files
authored
fix(mixedModuleGraph): handle undefined id in getModulesByFile (#18201)
1 parent 9470011 commit 768a50f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

packages/vite/src/node/server/mixedModuleGraph.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -301,7 +301,7 @@ export class ModuleGraph {
301301
}
302302
if (ssrModules) {
303303
for (const mod of ssrModules) {
304-
if (!this._client.getModuleById(mod.id!)) {
304+
if (mod.id == null || !this._client.getModuleById(mod.id)) {
305305
result.add(this.getBackwardCompatibleBrowserModuleNode(mod)!)
306306
}
307307
}

0 commit comments

Comments
 (0)