Commit b6bcf72
fix(vite): clear module runner cache before dev worker reload
The dev worker's ViteEnvRunner.reload() re-imports the environment entry
without clearing the ModuleRunner's evaluatedModules cache. When a module's
transform is already populated on the Vite side at fetch time (for example
re-transformed by an assets crawl during the reload itself), fetchModule
answers {cache: true} and the runner reuses the stale evaluation, so the
server keeps executing old code until the dev server is restarted.
Vite's own full-reload handler clears evaluatedModules before re-importing;
do the same here.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent 77b77ff commit b6bcf72
1 file changed
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
55 | 55 | | |
56 | 56 | | |
57 | 57 | | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
58 | 63 | | |
59 | 64 | | |
60 | 65 | | |
| |||
0 commit comments