We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a453637 commit fdb1e46Copy full SHA for fdb1e46
packages/vitest/src/node/core.ts
@@ -596,11 +596,13 @@ export class Vitest {
596
const updateLastChanged = (id: string) => {
597
const projects = this.getModuleProjects(id)
598
projects.forEach(({ server, browser }) => {
599
- const mods = server.moduleGraph.getModulesByFile(id)
600
- mods?.forEach((mod) => {
601
- server.moduleGraph.invalidateModule(mod)
602
- browser?.moduleGraph.invalidateModule(mod)
603
- })
+ const serverMods = server.moduleGraph.getModulesByFile(id)
+ serverMods?.forEach(mod => server.moduleGraph.invalidateModule(mod))
+
+ if (browser) {
+ const browserMods = browser.moduleGraph.getModulesByFile(id)
604
+ browserMods?.forEach(mod => browser.moduleGraph.invalidateModule(mod))
605
+ }
606
})
607
}
608
0 commit comments