Skip to content

Hydration mismatch when rendering snippets with async values #17225

@henrykrinkle01

Description

@henrykrinkle01

Describe the bug

When a snippet renders an async value with ssr enabled, there's a warning about hydration mismatch. It still renders correctly however. Not sure if there's any consequence or just a false positive.

Reproduction

<script lang="ts">
	const count = await 1;
</script>

{#snippet foo(count: number)}
	{count}
{/snippet}
{@render foo(count)}

https://stackblitz.com/edit/async-snippet-hydration-problem?file=src%2Froutes%2F%2Bpage.svelte

Logs

+layout.svelte:34 [svelte] hydration_mismatchHydration failed because the initial UI does not match what was rendered on the server

System Info

svelte@5.43.14
kit@2.49.0

Severity

annoyance

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