Skip to content

Svelte 5 does not allow let bindings on forwarded slots, but Svelte 4 does #10382

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

Closed
dimfeld opened this issue Feb 3, 2024 · 2 comments · Fixed by #10391
Closed

Svelte 5 does not allow let bindings on forwarded slots, but Svelte 4 does #10382

dimfeld opened this issue Feb 3, 2024 · 2 comments · Fixed by #10391
Labels
Milestone

Comments

@dimfeld
Copy link
Contributor

dimfeld commented Feb 3, 2024

Describe the bug

Code such as <slot name="a" slot="a" let:abc abc={abc}> throws a compiler error in Svelte 5 that "slot can only receive attributes, not directives". This works fine on Svelte 4.

This is mostly a problem when using old code or libraries that contain this syntax.

Reproduction

Svelte 5 REPL

See Component2.svelte for where the error occurs

Svelte 4 Equivalent REPL that works

Logs

No response

System Info

Svelte REPL

Severity

blocking an upgrade

@mquandalle
Copy link

Not exactly the same issue, but #9797 looks similar and might be fixed at the same time.

@dimfeld
Copy link
Contributor Author

dimfeld commented Feb 4, 2024

I don't think resolving this one will fix 9797. This one comes up in a different part of the code that is more just around syntax checking, whereas 9797 looks like it comes up in a later compiler phase.

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

Successfully merging a pull request may close this issue.

3 participants