Currently used vite.ssrLoadModule() doesn't support the HMR API fully. Vite doesn't call hot.dispose/hot.accept functions for invalidated modules, thus making server-side long-living tasks (i.e. setInterval() or event listener callbacks) stack on top of each other each time a reload happens.
Describe the proposed solution
Call runtime.executeEntrypoint() instead of vite.ssrLoadModule().
Describe the problem
Currently used
vite.ssrLoadModule()
doesn't support the HMR API fully. Vite doesn't callhot.dispose
/hot.accept
functions for invalidated modules, thus making server-side long-living tasks (i.e.setInterval()
or event listener callbacks) stack on top of each other each time a reload happens.Describe the proposed solution
Call
runtime.executeEntrypoint()
instead ofvite.ssrLoadModule()
.Alternatives considered
No response
Importance
i cannot use SvelteKit without it
Additional Information
No response