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

Duplicate slot names using Svelte 3.35 #25

Closed
simonlayfield opened this issue Mar 27, 2021 · 1 comment
Closed

Duplicate slot names using Svelte 3.35 #25

simonlayfield opened this issue Mar 27, 2021 · 1 comment

Comments

@simonlayfield
Copy link

simonlayfield commented Mar 27, 2021

Hey!

First of all thanks so much for Svelte Chota!

I thought I'd quickly create something using Svelte Kit this weekend and noticed that there are issues with slots with duplicate names, specifically when I tried to use the Nav component:

[plugin:vite-plugin-svelte] Duplicate slot name "right" in <Nav>

Looks like this issue was picked up here: sveltejs/svelte#6061

I'm going to see if I can work out what will need to change in order to fix it, but thought I'd add the issue for awareness. Also, I may not have the skill required to get anywhere with fixing it!

@simonlayfield simonlayfield changed the title Duplicate slot names using Svelte Kit Duplicate slot names using Svelte 3.35 Mar 27, 2021
@AlexxNB
Copy link
Owner

AlexxNB commented Apr 13, 2021

Yeah, this happening because now we have <svelte:fragment/> and can't use multiple <div slot="blah"></div><div slot="blah"></div> .
So if you have something like this in your code:

<div slot="right">1</div>
<div slot="right">2</div>

You should replace it with:

<svelte:fragment slot="right">
    <div>1</div>
    <div>2</div>
</svelte:fragment>

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