Closed Rich-Harris closed 9 months ago
Maybe #4824 is related?
No, that's about client-side HMR
I know about it. Both reproduction behaved simillar so I thought it might have the same reason underlying. I noticed I was misunderstanding the issue.
Describe the bug
If a module loaded with
ssrLoadModule
is invalidated, it is evicted from the module graph but isn't cleaned up. If it's subsequently loaded again, any resources created in the old module (websocket servers, timeouts, etc) will stick around, causing issues like https://github.com/sveltejs/kit/issues/2903.Ideally, I think the HMR API would apply to
ssrLoadModule
as well as modules loaded in the browser.Reproduction
https://github.com/Rich-Harris/vite-ssr-hmr-repro
System Info
Used Package Manager
pnpm
Logs
No response
Validations