Describe the bug
Given component (notice how footer is optional)
<script lang="ts">
type Props = {
children: Snippet
footer?: Snippet
}
const { children, footer } = $props()
</script>
<div>
{@render children()}
{#if footer}
{@render footer()}
{/if}
</div>
This is allowed
<script lang="ts">
import Bug from './Bug.svelte'
</script>
<Bug>
{#snippet children()}
children
{/snippet}
{#snippet footer()}
footer
{/snippet}
</Bug>
<script lang="ts">
import Bug from './Bug.svelte'
</script>
<Bug>
{#snippet children()}
children
{/snippet}
</Bug>
While this gives an error Cannot use explicit children snippet at the same time as implicit children content. Remove either the non-whitespace content or the children snippet block
<script lang="ts">
import Bug from './Bug.svelte'
</script>
<Bug>
{#snippet children()}
children
{/snippet}
{#if true}
{#snippet footer()}
footer
{/snippet}
{/if}
</Bug>
Not sure if this is a limitation or bug. If latter in my opinion this should just work.
Reproduction
Link to the playgound
Logs
No response
System Info
Severity
annoyance
Describe the bug
Given component (notice how footer is optional)
This is allowed
While this gives an error
Cannot use explicit children snippet at the same time as implicit children content. Remove either the non-whitespace content or the children snippet blockNot sure if this is a limitation or bug. If latter in my opinion this should just work.
Reproduction
Link to the playgound
Logs
No response
System Info
Severity
annoyance