Skip to content

Svelte 5: (non-state-reference) moduleVariable is updated, but is not declared with $state(...)...  #11269

@qupig

Description

@qupig

Describe the bug

moduleVariable is updated, but is not declared with $state(...). Changing its value will not correctly trigger updates.(non-state-reference)eslint(svelte/valid-compile)

moduleVariable is updated, but is not declared with $state(...). Changing its value will not correctly trigger updates.svelte(non-state-reference)

Refer to the reproduction below.

It's worth noting that this is reported as error rather than warn in eslint-svelte.

I don't know why it just shows up as warn in the source and REPL.

In other words, it shows up as a red wavy line in local VSCode.

Reproduction

Svelte5-REPL

Logs

No response

System Info

"svelte": "5.0.0-next.110"

Severity

blocking an upgrade

Metadata

Metadata

Assignees

No one assigned

    Labels

    awaiting submitterneeds a reproduction, or clarification

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions