svelte icon indicating copy to clipboard operation
svelte copied to clipboard

Components with slot attribute can wrapped in `#if` statement do not produce any error/warning

Open harshmandan opened this issue 1 year ago • 1 comments

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: Stackblitz

Logs

No response

System Info

Sveltekit v2.0.4

Severity

annoyance

harshmandan avatar Dec 20 '23 10:12 harshmandan

Not just on components, using <slot name="etc" for="etc" /> for slot forwarding inside an {#if $$slots.etc} block also silently fails.

fnimick avatar Feb 08 '24 20:02 fnimick