Skip to content

Slots with dynamic component aren't working #4597

@elbourki

Description

@elbourki

Describe the bug
This was working perfectly fine in the previous versions of svelte, it stopped working when I upgraded Svelte from 3.19.2 to 3.20.1.
I'm not sure what causes the issue but it happens if you have a slot wrapped in a div, and used <svelte:component/> as a fallback. Removing the div or replacing <svelte:component/> works just fine.

Logs
Uncaught (in promise): div is not defined

To Reproduce
https://svelte.dev/repl/41a85b6cd92f4e1fb4773b90eb5c97ca

Expected behavior
Show the other component

Stacktraces

Stack trace
Component.svelte:46 Uncaught (in promise) ReferenceError: div is not defined
at Object.update [as p] (Component.svelte:46)
at Object.update [as p] (Component.svelte:44)
at update (index.mjs:687)
at flush (index.mjs:656)

Information about your Svelte project:

  • Your browser and the version: Chrome 80

  • Your operating system: Windows 10

  • Svelte version: 3.20.1

  • Whether your project uses Webpack or Rollup; Webpack

Severity
Honestly, this blocks my usage of Svelte, I thought this component was finished but when it suddenly stopped working I had to dig in the changes I have made for a few hours before finding out it was an issue with Svelte itself. And the component is a pretty big deal in my project.

Metadata

Metadata

Assignees

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