Skip to content

@html directive hydration bug #6633

@mquandalle

Description

@mquandalle

Describe the bug

This bug is difficult to describe in prose, I recommend looking at the reproduction first.

When a {@html myContent} directive is used after two conditions {#if}, the content isn't rendered on the client-side. The content is still rendered on the server causing the content to blink.

As showed in the reproduction, the issue only arise when the myContent isn't wrapped in html tags, which is normally supported in svelte.

Reproduction

https://github.com/mquandalle/repro-sveltekit-html-directive-bug/blob/master/src/routes/index.svelte

Logs

No response

System Info

System:
    OS: Linux 5.11 Pop!_OS 21.04
    CPU: (8) x64 Intel(R) Core(TM) i7-8550U CPU @ 1.80GHz
    Memory: 471.12 MB / 15.40 GB
    Container: Yes
    Shell: 5.8 - /usr/bin/zsh
  Binaries:
    Node: 16.0.0 - ~/.nvm/versions/node/v16.0.0/bin/node
    Yarn: 1.22.10 - ~/.nvm/versions/node/v16.0.0/bin/yarn
    npm: 7.10.0 - ~/.nvm/versions/node/v16.0.0/bin/npm
  Browsers:
    Firefox: 90.0
  npmPackages:
    @sveltejs/kit: next => 1.0.0-next.144 
    svelte: ^3.34.0 => 3.42.1

Severity

annoyance

Additional Information

No response

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