Skip to content

Svelte 5: Store auto-subscription not working in .svelte.js|ts files #12728

@theetrain

Description

@theetrain

Describe the bug

When importing stores in .svelte.js or .svelte.ts files, using $ to auto-subscribe to the store does not work as expected. I'm not sure if this is intended behaviour since manually using .subscribe requires a callback.

My goal is to create a class that contains values $derived() from a store.

Reproduction

Svelte 5 reproduction

Logs

No response

System Info

Svelte 5 REPL `v5.0.0-next.208`

Severity

annoyance

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions