Skip to content

Commit 00854d5

Browse files
bfangerRich-Harrisbluwy
authored
fix: <Route> received an unexpected slot "default" (#3115)
* fix: <Route> received an unexpected slot "default" * Update .changeset/moody-students-report.md Co-authored-by: Bjorn Lu <[email protected]> Co-authored-by: Rich Harris <[email protected]> Co-authored-by: Bjorn Lu <[email protected]>
1 parent 69832a4 commit 00854d5

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
'@sveltejs/kit': patch
3+
---
4+
5+
fix `<Route> received an unexpected slot "default"` warning

packages/kit/src/core/create_app/index.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -130,11 +130,13 @@ function generate_app(manifest_data) {
130130

131131
while (l--) {
132132
pyramid = `
133-
<svelte:component this={components[${l}]} {...(props_${l} || {})}>
134-
{#if components[${l + 1}]}
133+
{#if components[${l + 1}]}
134+
<svelte:component this={components[${l}]} {...(props_${l} || {})}>
135135
${pyramid.replace(/\n/g, '\n\t\t\t\t\t')}
136-
{/if}
137-
</svelte:component>
136+
</svelte:component>
137+
{:else}
138+
<svelte:component this={components[${l}]} {...(props_${l} || {})} />
139+
{/if}
138140
`
139141
.replace(/^\t\t\t/gm, '')
140142
.trim();

0 commit comments

Comments
 (0)