Skip to content

A derived value sometimes loses its reactivity #14896

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
hironytic opened this issue Jan 5, 2025 · 1 comment · Fixed by #14899
Closed

A derived value sometimes loses its reactivity #14896

hironytic opened this issue Jan 5, 2025 · 1 comment · Fixed by #14899
Assignees

Comments

@hironytic
Copy link

hironytic commented Jan 5, 2025

Describe the bug

After upgrading to 5.16.1, I noticed that a derived value sometimes loses its reactivity in my project.
I couldn’t find the exact trigger though, I could find reproduction steps in a minimal code in the playground.

Reproduction steps:

  1. Click “d” button, then current id changes to 4, and name to d.
  2. Click “Show / Hide” button, then the content above is hidden.
  3. Click “Show / Hide” button again, then the content is back.
  4. Click “c” button, then current id changes to 3, and name to c.
  5. Click “b” button, then,
    • Expected behavior: current id changes to 2, and name to b.
    • Actual behavior: current id changes to 2, but name doesn’t change.

Reproduction

https://svelte.dev/playground/c10266b02aab40e58b93a9545c8ac639?version=5.16.1 (Reproducible)

https://svelte.dev/playground/c10266b02aab40e58b93a9545c8ac639?version=5.16.0 (Work as expected)

Logs

No response

System Info

System:
    OS: macOS 15.2
    CPU: (8) arm64 Apple M2
    Memory: 133.42 MB / 24.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 20.15.0 - ~/.volta/tools/image/node/20.15.0/bin/node
    Yarn: 1.22.19 - ~/.volta/tools/image/yarn/1.22.19/bin/yarn
    npm: 10.7.0 - ~/.volta/tools/image/npm/10.7.0/bin/npm
    pnpm: 9.6.0 - /opt/homebrew/bin/pnpm
  Browsers:
    Chrome: 131.0.6778.205
    Safari: 18.2
  npmPackages:
    svelte: ^5.16.1 => 5.16.1

Severity

blocking an upgrade

@Leonidaz
Copy link

Leonidaz commented Jan 5, 2025

@trueadm looks like a change in the #14855 is now causing this bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants