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

Svelte 5 + SvelteKit: Warning "slot is missing" if {render children()} is used inside +layout.svelte #9691

Closed
johannesmutter opened this issue Nov 28, 2023 · 2 comments

Comments

@johannesmutter
Copy link

Describe the bug

+layout.svelte file requires either a <slot /> or {@render children()} to render child routes.
However in Svelte 5 if we use {@render children()} we will get this warning in the console:

src/routes/+layout.svelte
`<slot />` missing — inner content will not be rendered

Adding this commented line will hide the warning <!-- <slot /> -->

Reproduction

This simple REPL demonstrates the issue:
https://www.sveltelab.dev/f16ajcfi2z70ueq?files=.%2Fsrc%2Froutes%2F%2Blayout.svelte

(see the console)

Logs

src/routes/+layout.svelte
`<slot />` missing — inner content will not be rendered


### System Info

```shell
"@sveltejs/kit": "^1.27.4",
	   "svelte": "^5.0.0-next.1",

Severity

annoyance

@brunnerh
Copy link
Member

@geoffrich
Copy link
Member

Thanks, closing as a duplicate of sveltejs/kit#11127. It will need to be fixed in the Kit repo anyway.

@geoffrich geoffrich closed this as not planned Won't fix, can't repro, duplicate, stale Nov 28, 2023
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

3 participants