Closed JReinhold closed 11 months ago
I asked the other maintainers about this. svelte-hmr doesn't work for 5. The hmr api is going to be added directly into svelte compiler in dev mode at some point. Given that this library will never support Svelte 5, I'm not sure this is the correct fix.
In general svelte5 support in vite-plugin-svelte (and sveltekit) is marked as experimental, svelte-5 is still in alpha so expect breaking changes from time to time. Due to the experimental nature there are a few things that are not perfect rn and peer dependency ranges is one of them.
pnpm allows you to silence peer dependency warnings by name, maybe yarn has a similar feature? Otherwise i'd recommend to disable strict peer checks for the svelte5 test altogether.
It's very likely that there is going to be a new major release for vite-plugin-svelte to add proper support for svelte5 that no longer depends on svelte-hmr.
That's fair, thanks for the feedback!
We actually explicitly tell Yarn to error on incompatible peer dependencies in our CI. This does cause problems sometimes with upstreams like this, but it also often catches problems caused by our internal packages.
Either way this is something to solve on our side, I'll figure out a workaround.
Expand the peer dependency range for Svelte to include Svelte 5 prereleases.
SvelteKit uses
svelte-hmr
under the hood, but given thatsvelte-hmr
doesn't allow Svelte 5, strict package managers will consider a SvelteKit + Svelte 5 project invalid even if SvelteKit supports it in the dependency range.Here's what
yarn explain peer-requirements
has to say on the matter:This is currently blocking Storybook from testing against Svelte 5 in our ecosystem CI