Skip to content

If I have any empty <svelte:fragment></svelte:fragment> the slot is not rendered. #8541

@frederikhors

Description

@frederikhors

Describe the bug

If I have in the parent:

//...

{#if $$slots.head}
  <PlayerHead {title}>
    <slot name="head" {data} />
  </PlayerHead>
{/if}

and I use the empty:

<svelte:fragment slot="head"></svelte:fragment>

the head slot is not rendered.

If I use the below instead:

<div slot="head"></div>

the slot is rendered.

Why I cannot use svelte:fragment if empty?

System Info

System:
    OS: Windows 10
  Binaries:
    Node: 18.16.0
    npm: 9.6.5
  Browsers:
    Chromium (107.0.1418.62)

Severity

blocking all usage of svelte

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions