Open bfontaine opened 5 days ago
Thanks for the report! The two errors in you encounter seems to be related to new Svelte 5 syntax not being recognized by Svelte 4. For the first one, I was surprised that the <T>
component is parsed even though it is not imported. It seems that Vite is trying to optimize deps, which include the new <T>
component.
For that one, adding the path to the library to optimizeDeps.exclude in the vite config might solve the issue. However with the second one, it seems to be related to Svelte 5's compatibility code for Svelte 4 syntax (the run
function to replace $
). Looking at the error made me realize that to make it work with Svelte 4, I'll need to prepare a separate component specifically for Svelte 4 that uses the $
symbol instead of the run
function, which I'm not sure is worth the complexity.
Now I'm thinking it's better to keep using the older v0.1.x instead for Svelte 4 and only migrate to v0.2.0 when migrating to Svelte 5. There is also no feature difference between the two at the moment, other than Svelte 5 support. Any thoughts?
Hello, Following #14 I upgraded to 0.2.0 in a Svelte 4.x project and replaced all
T
s withLegacyT
but I get an error:The error comes from
vite-plugin-svelte
but I’m using the latest version before 4.0.0, which dropped support for Svelte 4.x. Any idea?