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
Abstract State Router / Svelte State Renderer render the Svelte component, and then add extra properties on the component instance to later use in other parts of the lifecycle.
In Svelte 4, triggering HMR on one of these components worked fine, and the extra properties stayed intact. In Svelte 5, they get removed, and this breaks the router after HMR. Reloading the page fixes this issue, but I'd prefer to keep using HMR in Svelte 5.
This is an incompatibility with svelte-state-renderer and abstract-state-router in the fact they are using internals around how HMR worked in Svelte 3/4. This is no longer supported in Svelte 5, so we recommend speaking to the library author to upgrade support for Svelte 5.
Describe the bug
Abstract State Router / Svelte State Renderer render the Svelte component, and then add extra properties on the component instance to later use in other parts of the lifecycle.
In Svelte 4, triggering HMR on one of these components worked fine, and the extra properties stayed intact. In Svelte 5, they get removed, and this breaks the router after HMR. Reloading the page fixes this issue, but I'd prefer to keep using HMR in Svelte 5.
I also posted about this in the Svelte discord, if you want more context: https://discord.com/channels/457912077277855764/1323699302073372843
Reproduction
https://github.com/Mtn-View/svelte-5-hmr-issue
Logs
No response
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: