Closed
Description
Describe the bug
Given this use test case:
<script>
const { count } = $props();
let local = $derived.by(() => {
const local = $state({ count })
return local;
});
</script>
<div>Local: {local.count}</div>
You can see the compiled output for the return local
is incorrectly return $.get(local);
This is because we are shadowing the local
binding.
This means that we then push the state object into the dependencies for the derived signal causing everything to crash to a halt.