Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not working in svelte5 #47

Open
ryoppippi opened this issue Oct 1, 2024 · 7 comments
Open

Not working in svelte5 #47

ryoppippi opened this issue Oct 1, 2024 · 7 comments

Comments

@ryoppippi
Copy link

When components includes snippet syntax, it causes Syntax Error

@invakid404
Copy link
Owner

Hey @ryoppippi, thanks for reporting this! I intend to add Svelte 5 support to this repo soon. As of today, it only supports Svelte 4.

Svelte 5 has quite a few internal differences from Svelte 4, so I'm still determining the scope of this. For example, how you instantiate components is different in Svelte 5, so that needs to change at the very least.

I will keep supporting Svelte 4 in this project since Svelte 5 is not stable yet. The internal details of Svelte 5 may change before its official release, so I don't want to fully commit to it yet. However, I might consider doing this in a beta release.

@invakid404
Copy link
Owner

@ryoppippi Getting basic Svelte 5 support turned out to be easier than expected, but there do indeed appear to be some weird parsing issues, which I'd assume is the issue you're talking about. It isn't related to any Svelte 5 features, though, as I am currently testing this on a codebase that I am migrating from Svelte 4 to Svelte 5. I'll need to look into this more.

@ryoppippi
Copy link
Author

Thank you for you quick investigation!! If you need help, I'll help you!

@invakid404
Copy link
Owner

@ryoppippi I think I got everything to work in 2.0.0-beta.3. I successfully migrated my personal website to Svelte 5, and all islands appear to work as intended.

The parse errors on my end were caused by the fact that vitePreprocess no longer preprocesses scripts by default. It seems like you must pass { script: true } to vitePreprocess in your Svelte config for it to work. I've updated the README to reflect this.

Let me know if anything is still broken on your end.

@ryoppippi
Copy link
Author

@invakid404 Thank you for your work.
Actually, it still doesn't work in my website.
I'll create a repro repo later! Thanks

@invakid404
Copy link
Owner

@ryoppippi Sorry to hear that; I'll definitely look into it once you provide a reproduction, it's not unlikely I overlooked something :D

@ryoppippi
Copy link
Author

I'm trying to create a minimal reproduction. Wait a moment.
Hmm this is wired

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants