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

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy