Skip to content
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

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

Open
harshmandan opened this issue Dec 20, 2023 · 1 comment

Comments

@harshmandan
Copy link

harshmandan commented Dec 20, 2023

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

@fnimick
Copy link

fnimick commented Feb 8, 2024

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

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

No branches or pull requests

2 participants