Skip to content

Commit

Permalink
fix(hmr): don't mutate module graph when collecting modules (#16302)
Browse files Browse the repository at this point in the history
  • Loading branch information
sapphi-red authored Mar 29, 2024
1 parent 1f53796 commit dfffea1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/vite/src/node/server/hmr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ export async function handleHMRUpdate(
return
}

const mods = moduleGraph.getModulesByFile(file) || new Set()
const mods = new Set(moduleGraph.getModulesByFile(file))
if (type === 'create' || type === 'delete') {
for (const mod of getAffectedGlobModules(file, server)) {
mods.add(mod)
Expand Down

0 comments on commit dfffea1

Please sign in to comment.