svelte-5-hmr-issue Svelte Themes

Svelte 5 Hmr Issue

Repo for Svelte 5 HMR removing properties on a component instance

Svelte 5 HMR Issue

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.

How to Reproduce

  • git clone
  • npm i
  • npx vite
  • Change App.svelte and change to trigger HMR
  • Click one of the links on the page, and you will get the error.

Top categories

Loading Svelte Themes