Skip to content

Svelte 5 breaks custom store behavior with image sources #13512

@mattpilott

Description

@mattpilott

Describe the bug

In testing Svelte 5 (262) I'm seeing a difference in behavior with respect to custom stores and image sources.

This repo has an image being pulled from a custom store that behaves like writable but with localstorage. In svelte 4 it works as intended, updating to svelte 5 leads to the initial state being rendered when the stored state should be rendered.

Reproduction

https://github.com/mattpilott/s5-store-test

Install deps
Run dev
You will see the Square logo
Click the button
The logo will now change to New York Times logo
Hitting refresh in the browser you will see the Square logo when you should be seeing the NYT logo

Downgrading to svelte 4 and everything works

Logs

No response

System Info

System:
    OS: macOS 15.1
    CPU: (16) arm64 Apple M3 Max
    Memory: 821.83 MB / 48.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.18.0 - /opt/homebrew/opt/node@20/bin/node
    npm: 10.8.2 - /opt/homebrew/opt/node@20/bin/npm
    bun: 1.1.29 - ~/.bun/bin/bun
    Watchman: 2024.09.30.00 - /opt/homebrew/bin/watchman
  Browsers:
    Safari: 18.1
  npmPackages:
    svelte: ^5.0.0-next.262 => 5.0.0-next.262

Severity

blocking an upgrade

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