You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
If a reactive declaration is an assignment, Svelte automatically replaces $: with let in SSR mode if the variable on the left hand side hasn't been declared. It does this even if the left hand side is a member expression:
<script>
$: user = {}; $:user.name='world';
</script>
<h1>Hello {user.name}!</h1>
Describe the bug
If a reactive declaration is an assignment, Svelte automatically replaces
$:
withlet
in SSR mode if the variable on the left hand side hasn't been declared. It does this even if the left hand side is a member expression:To Reproduce
https://svelte.dev/repl/b8f185ca9b104f4c8d08f2e5846cfaf0?version=3.24.1
Expected behavior
Only the
$: user = ...
declaration should have alet
prepended.Severity
Can be worked around (e.g.
$: true && (user.name = 'world');
) but it's a bit annoying. Relatively infrequent occurrence though.The text was updated successfully, but these errors were encountered: