Skip to content

5.43.0: Error: Cannot read properties of undefined (reading 'f') while destructuring async objects #17236

@henrykrinkle01

Description

@henrykrinkle01

Describe the bug

<script lang="ts">
	async function getUser() {
		return {
			id: 1,
			name: 'Rich'
		};
	}
	const user = $derived(await getUser());
	const { id, name } = $derived(user);
</script>

{id}-{name}

This results in error but deriving the object without destructuring works.
I think this issue is similar to #17224, which is supposed to be fixed by #17226. However, it doesn't fix this.

Reproduction

https://svelte.dev/playground/175e6f5e85a448f5a9f340fabbb89461?version=5.44.0

Logs

TypeError: Cannot read properties of undefined (reading 'f')

System Info

svelte@5.44.0

Severity

annoyance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions