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 only happens in very specific circumstances, e.g. "binding" to a set-only property of a snippet argument.
The warning is not easy to understand in that context and will not happen with a regular property binding.
(The code behaves as expected so the warning feels like it might be a false positive.)
Reproduction
<script>
let elementFunBind =$state();$inspect('fun', elementFunBind?.tagName);let elementPropBind =$state();$inspect('prop', elementPropBind?.tagName);let elementEvent =$state();$inspect('event', elementEvent?.tagName);</script>{#snippet funBind(context)}<!-- only this triggers the warning:--><input value="via fun" bind:this={() => {}, e=>context.element= e} />{/snippet}{@render funBind({ setelement(e) { elementFunBind = e } })}{#snippet propBind(context)}<textarea bind:this={context.element}>via prop</textarea>{/snippet}{@render propBind({ setelement(e) { elementPropBind = e } })}{#snippet event(context)}<button onclick={e=>context.element=e.target}>via event</button>{/snippet}{@render event({ setelement(e) { elementEvent = e } })}
The text was updated successfully, but these errors were encountered:
brunnerh
changed the title
assignment_value_stale error possible with read-only function bindingsassignment_value_stale error possible with function bindings
Mar 19, 2025
brunnerh
changed the title
assignment_value_stale error possible with function bindingsassignment_value_stale warning possible with function bindings
Mar 19, 2025
Describe the bug
This only happens in very specific circumstances, e.g. "binding" to a set-only property of a snippet argument.
The warning is not easy to understand in that context and will not happen with a regular property binding.
(The code behaves as expected so the warning feels like it might be a false positive.)
Reproduction
Playground
Logs
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: