svelte
svelte copied to clipboard
Components with slot attribute can wrapped in `#if` statement do not produce any error/warning
Describe the bug
Slots can't be wrapped in #if statements, but on using the slot with a component which is wrapped in #if statement, the compiler does not produce any error.
Reproduction
Here's a repo for reproduction:
https://stackblitz.com/edit/sveltejs-kit-template-default-wvmusb?file=src%2Froutes%2F%2Bpage.svelte
Here's a screenshot:
Logs
No response
System Info
Sveltekit v2.0.4
Severity
annoyance
Not just on components, using <slot name="etc" for="etc" /> for slot forwarding inside an {#if $$slots.etc} block also silently fails.