Skip to content

[5.55.10] Hydration mismatch when reading an async derived in component prop #18344

Description

@henrykrinkle01

Describe the bug

Starts to appear in 5.55.10. I suspect this is the reason element ref bindings are broken in my app (a dialog trigger doesn't open dialog when clicked). Still investigating.

Reproduction

<script>
	let { onclick } = $props();
</script>
 <button {onclick}> A button </button>
<script lang="ts">
	import Button from '$lib/button.svelte';
	async function getFoo() {
		return 'foo';
	}
	const foo = $derived(await getFoo());
</script>

{foo}
<Button
	onclick={()=>foo}
/>

https://stackblitz.com/edit/sveltejs-kit-template-default-h6zh24k5?file=src%2Froutes%2F%2Bpage.svelte,src%2Flib%2Fbutton.svelte

Logs

System Info

svelte@5.55.10
kit@2.61.1

Severity

blocking an upgrade

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions