Closed
Description
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
<script>
import { writable } from 'svelte/store';
const user = writable(0);
const users = [];
$: selected = users.find(user => user.id == $user);
// Remove to get error:
$: console.log($user);
</script>
Svelte 5
Svelte 4 - Always errors as I would have expected
Logs
No response
System Info
REPL - Svelte v5.0.0-next.100
Severity
annoyance
Metadata
Metadata
Assignees
Labels
No labels