Skip to content

Commit e7f497b

Browse files
committed
fix(hmr): deregister a module's own hot reload callbacks when it gets replaced
1 parent 857b460 commit e7f497b

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/hotModuleReplacement.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ const invalidateSoon = debounce(() => {
6464
.join('')}`
6565
)
6666
for (const id of unloadIds) delete require.cache[id]
67+
moduleGraph.delete(unloadIds)
6768
for (const callback of callbacks) callback()
6869
log(`hot reload complete`)
6970
}

0 commit comments

Comments
 (0)