Skip to content

next.167 breaks <svelte:component> in development mode #12233

Closed
@vits

Description

@vits

Describe the bug

Hello,
next.167 breaks <svelte:component> in development mode (vite). Changing this value makes component disappear. If svelte:component is put inside {#key ..} and key is updated as well, new component is appended to the old ones, ie. <svelte:component> grows and renders all previous components before the new one.

This problem does not exist in next.166 and disappears in production after vite build.

Reproduction

Can't provide REPL, as there is no problem in production mode.
C1 and C2 are any components, just different visually.
Changing to V5 syntax also doesn't help.

<script>
import C1 from "./C1.svelte";
import C2 from "./C2.svelte";

let comp = C1
function change() {
    comp = comp === C1 ? C2 : C1;
}
</script>

<svelte:component this={comp}></svelte:component>
<button on:click={change}>change</button>

Logs

No response

System Info

svelte: 5.0.0-next.167

Severity

blocking all usage of svelte

Metadata

Metadata

Assignees

No one assigned

    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