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
This is a bit of a corner case:
If there is a variable shadowing a (top-level) store, this will either result in an error or not depending on whether an auto-subscription has been created elsewhere.
Reproduction
<script>
import { writable } from'svelte/store';constuser=writable(0);constusers= []; $: selected =users.find(user=>user.id== $user);// Remove to get error: $:console.log($user);
</script>
The text was updated successfully, but these errors were encountered:
brunnerh
changed the title
Store auto-subscriptions cause inconsistent variable shadowing.
Svelte 5: Store auto-subscriptions cause inconsistent variable shadowing.
Apr 12, 2024
Describe the bug
This is a bit of a corner case:
If there is a variable shadowing a (top-level) store, this will either result in an error or not depending on whether an auto-subscription has been created elsewhere.
Reproduction
Svelte 5
Svelte 4 - Always errors as I would have expected
Logs
No response
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: