Skip to content

Can't modify state in module context #14250

@michielp1807

Description

@michielp1807

Describe the bug

If we define some $state in a module script, then attempts to modify that state will lead to a vague "module.end is null" error in Firefox, or a vague "Cannot read properties of null (reading 'line')" error in Chrome.

Reproduction

Note that with simple state types, such as just a number or a string, it does work fine without problems.

Logs

No response

System Info

System:
    OS: Linux 5.15 Ubuntu 20.04.6 LTS (Focal Fossa)
    CPU: (4) x64 AMD Ryzen 3 3200G with Radeon Vega Graphics
    Memory: 6.45 GB / 15.54 GB
    Container: Yes
    Shell: 5.0.17 - /bin/bash
  Binaries:
    Node: 22.11.0 - ~/.nvm/versions/node/v22.11.0/bin/node
    npm: 10.9.0 - ~/.nvm/versions/node/v22.11.0/bin/npm
  Browsers:
    Chromium: 130.0.6723.91
  npmPackages:
    svelte: ^5.0.0 => 5.1.13

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