You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Bug]: Dev server's in-memory output file system keeps every hot-update file #8736
In dev (writeToDisk: false), the memfs output file system never drops old files. Every edit adds index.<hash>.hot-update.{js,js.map,json}, and a chunk that a rebuild no longer emits (removed or renamed dynamic import) stays too. Memory grows with every save for the life of the dev server. No browser needs to be connected.
The repro rewrites src/index.js N times and lists compiler.outputFileSystem after each batch:
$ node repro.mjs --cycles=100
edits= 0 memfsFiles= 5 hotUpdateFiles= 0 memfsBytes= 0.1MB
edits= 50 memfsFiles= 155 hotUpdateFiles= 150 memfsBytes= 1.2MB
edits= 100 memfsFiles= 311 hotUpdateFiles= 306 memfsBytes= 2.3MB
$ node repro.mjs --cycles=50 --rotate-chunk # each edit also swaps chunks/lazy-<i>.js for a new one
edits= 50 memfsFiles= 278 hotUpdateFiles= 171 lazyChunkFiles= 102 memfsBytes= 1.7MB
The bytes scale with the edited modules; in a mid-sized app we saw ~260 KB retained per save.
With tools: { rspack: { output: { clean: true } } } the volume stays flat and HMR still works:
Expected: a roughly constant number of files in the dev output file system across edits, without the output.clean override. For example, prune it after each compilation (or enable output.clean for the memfs case), keeping the last hot update or two for clients one step behind.
Activity
chenjiahan commentedon Oct 27, 2026
Thanks for the feedback! This issue will be fixed in the next release