You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The usage of snippets (and slots) within custom elements is not clear from the documentation. The resulting order of DOM nodes is different between using a svelte component "normally" and as a custom element. I'm assuming this is unavoidable and due to the special nature of custom elements. However, the corresponding caveats for using slots/snippets within custom elements (assuming there some footguns lying around) are not documented on this page so I'm at a loss how to mitigate this issue.
I think this is probably the same issue as #12892 - the resolution of that issue ("use slots") is not clear to me. I'm probably missing something.
The text was updated successfully, but these errors were encountered:
mspae
changed the title
Svelte 5, slot/snippet and custom elements broken/usage not documented enough
slot/snippet and custom elements broken/usage not documented enough
May 8, 2025
mspae
changed the title
slot/snippet and custom elements broken/usage not documented enough
slot/snippet and custom elements broken/usage unclear
May 8, 2025
Describe the bug
The usage of snippets (and slots) within custom elements is not clear from the documentation. The resulting order of DOM nodes is different between using a svelte component "normally" and as a custom element. I'm assuming this is unavoidable and due to the special nature of custom elements. However, the corresponding caveats for using slots/snippets within custom elements (assuming there some footguns lying around) are not documented on this page so I'm at a loss how to mitigate this issue.
I think this is probably the same issue as #12892 - the resolution of that issue ("use slots") is not clear to me. I'm probably missing something.
Reproduction
https://svelte.dev/playground/87c914a892664f7990bae0fa38290278?version=5.28.2
(Same thing using the @render syntax https://svelte.dev/playground/d9ae949baaea4276a6bd6edcdb03a451?version=5.28.2)
Logs
System Info
Severity
blocking all usage of svelte
The text was updated successfully, but these errors were encountered: