Skip to content

Svelte 5: Global reactive states declared in a context="module" vs. a normal module do not behave the same #9924

@AdrianGonz97

Description

@AdrianGonz97

Describe the bug

I've previously brought this up in the svelte-5-alpha chat and thought that it'd be worth raising an issue for a discussion.

Currently, as shown in this REPL, declaring global reactive state in context="module" behaves more similarly to local state that's declared in a component, rather than global state that's declared in an external module.

I find this difference in behavior to be a bit confusing as I would expect the global state declared in both, the external module and in context="module", to behave the same.

Reproduction

REPL

Logs

No response

System Info

n/a

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