Skip to content

toStore not receiving updates from 5.22.3 onwardsΒ #15557

@jamesbirtles

Description

@jamesbirtles

Describe the bug

From 5.22.3 onwards, usage of toStore seems broken.

A simple case of wrapping some state

const count = toStore(() => counter, value => counter = value);

and then using it in the template for example

Count state: {counter}
Count store: {$count}

The count state updates as expected, but the count store never receives a new value.

Reproduction

See the following basic example:
https://svelte.dev/playground/0892822945674a63ad0d61aca0eba214?version=5.22.3

It works when running on 5.22.2:
https://svelte.dev/playground/0892822945674a63ad0d61aca0eba214?version=5.22.2

It also starts to work if you $inspect the store
https://svelte.dev/playground/a1380d57e6c24ab3aff00d8b74cda745?version=5.22.3

Logs

System Info

System:
    OS: Linux 6.11 cpe:/o:nixos:nixos:25.05 25.05 (Warbler)
    CPU: (16) x64 AMD Ryzen 7 7840U w/ Radeon  780M Graphics
    Memory: 41.81 GB / 60.64 GB
    Container: Yes
    Shell: 5.9 - /run/current-system/sw/bin/zsh
  Binaries:
    Node: 22.14.0 - /etc/profiles/per-user/james/bin/node
    Yarn: 1.22.22 - /etc/profiles/per-user/james/bin/yarn
    npm: 10.9.2 - /etc/profiles/per-user/james/bin/npm
  Browsers:
    Chromium: 134.0.6998.88
  npmPackages:
    svelte: ^5.23.2 => 5.23.

Severity

blocking an upgrade

Metadata

Metadata

Assignees

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