Skip to content

$state from destructured $props results into undefined variable #16078

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
7nik opened this issue Jun 4, 2025 · 0 comments · Fixed by #16081
Closed

$state from destructured $props results into undefined variable #16078

7nik opened this issue Jun 4, 2025 · 0 comments · Fixed by #16081

Comments

@7nik
Copy link
Contributor

7nik commented Jun 4, 2025

Describe the bug

let { data } = $props();
let { foo } = $state(data)

is compiled into

export default function Component($$anchor, $$props) {
	let tmp = data, foo = $.proxy(tmp.foo);

that crashes with error data is not defined.

From Discord thread

Reproduction

REPL

Logs

System Info

Svelte 5.33.0+

Severity

blocking an upgrade

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant