Skip to content

[migrate] slot="default" gets turned into {#snippet default()} instead of children() #13758

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
dominikg opened this issue Oct 21, 2024 · 0 comments · Fixed by #13760
Closed

Comments

@dominikg
Copy link
Member

Describe the bug

click on migrate in the reproduction link, see the compile error for snippet default.

<Component><div slot="default">default slot</div></Component>

gets turned into

<Component>{#snippet default()}<div >default slot</div>{/snippet}</Component>

but should be

<Component>{#snippet children()}<div >default slot</div>{/snippet}</Component>

workaround, find and replace slot="default" with an empty string in your .svelte files before running the migration or find and replace #snippet default with #snippet children

Reproduction

https://svelte-omnisite.vercel.app/playground/hello-world?version=5.0.0-next.272#H4sIAAAAAAAAA3VP0QqDMAz8lZIXX0TfXS2Mfca6B6cRCjUtbXQb4r8PRRSHe0pyl9zlRmiNxQjFfQT-eIRiASAFqrp5unqfxQEtz9iziniG144YiSMUIGMdjGelSbPpvAssbq7zjpBYtMF1IsnyDVklknnbIotZXJQieblgm-SiSea7HsntTsnGDCJax6WGBtuqt6xBrd1CyLwxg5K7l9IEKTC-GQoOPU7pn8i_3x2Dn7CH-NaxkvlSjnaP6QvENl3YbQEAAA==

Logs

default is a reserved word

System Info

playgroun

Severity

annoyance

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

Successfully merging a pull request may close this issue.

1 participant