Skip to content

False assignment_value_stale warning when storing state in class and using bind:group #14687

@Bladesheng

Description

@Bladesheng

Describe the bug

I am getting the assignment_value_stale warning when I store state in a class and then bind that state to group of checkboxes. According to the docs, I believe in this case the warning is not relevant and should not be printed.
Everything else works as expected though.

When the state is not stored in a class, there is no warning (correct).

When $state.raw([]) is used instead, there is also no warning.

This feels similar to #14643

Reproduction

https://svelte.dev/playground/59525517cbb8474ca7db39aacfa98586?version=5.11.2

Logs

▶
[svelte] assignment_value_stale
Assignment to `selectedOptions` property (App.svelte:19:14) will evaluate to the right-hand side, not the value of `selectedOptions` following the assignment. This may result in unexpected behaviour.
https://svelte.dev/e/assignment_value_stale
eval
playground:output:4148:47
untrack
playground:output:2696:11
console.warn
playground:output:4148:16
assignment_value_stale
playground:output:476:12
compare
playground:output:2819:4
assign
playground:output:2832:10
eval
playground:output:4104:18

System Info

Svelte 5.11.2, Rocky Linux, chrome, firefox

Severity

annoyance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions