Skip to content

Default slot always added in shadow DOM #64

@patricknelson

Description

@patricknelson

Describe the bug

When using the shadow DOM, the default slot is always being added, even if there's no real content. Results in the following error:

<Example_tag> received an unexpected slot "default".
Image

Reproduction

example-tag.svelte

<div class="wrapper">
	<div class="title"><slot name="title"></slot></div>
	<div class="content"><slot name="content"></slot></div>
</div>

index.html

<example-tag>
	<p slot="title">Default: <code>count</code> starts at 0, <code>award</code> at 100.</p>
	<counter-tag slot="content"></counter-tag>
</example-tag>

Logs

System Info

System:
    OS: Linux 6.6 Debian GNU/Linux 11 (bullseye) 11 (bullseye)
    CPU: (22) x64 Intel(R) Core(TM) Ultra 7 165H
    Memory: 12.57 GB / 15.62 GB
    Container: Yes
    Shell: 5.1.4 - /bin/bash
  Binaries:
    Node: 22.11.0 - ~/.nvm/versions/node/v22.11.0/bin/node
    Yarn: 1.22.22 - ~/.nvm/versions/node/v22.11.0/bin/yarn
    npm: 10.9.0 - ~/.nvm/versions/node/v22.11.0/bin/npm
  Browsers:
    Chrome: 121.0.6167.184
  npmPackages:
    svelte: ^4.2.18 => 4.2.18

Severity

blocking all usage of svelte-retag

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions