Skip to content

Object.assign breaks reactivity #15850

@TGlide

Description

@TGlide

Describe the bug

When using Object.assign, reactivity is no longer triggered when an item inside changes.

Reproduction

https://svelte.dev/playground/796c3698bfa240e6a5d4e9c8bf08bd1c?version=5.28.2

Logs

init count 0
init countObj 0
init countObjAssign 0
update count 1
update countObj 1
update count 2
update countObj 2
update count 3
update countObj 3

System Info

System:
    OS: Linux 6.6 cpe:/o:nixos:nixos:24.11 24.11 (Vicuna)
    CPU: (32) x64 AMD Ryzen 9 7950X3D 16-Core Processor
    Memory: 53.46 GB / 62.01 GB
    Container: Yes
    Shell: 3.7.1 - /run/current-system/sw/bin/fish
  Binaries:
    Node: 22.14.0 - /etc/profiles/per-user/thomasgl/bin/node
    Yarn: 1.22.22 - /etc/profiles/per-user/thomasgl/bin/yarn
    npm: 10.9.2 - /etc/profiles/per-user/thomasgl/bin/npm
    pnpm: 9.15.5 - /etc/profiles/per-user/thomasgl/bin/pnpm
    bun: 1.2.2 - /etc/profiles/per-user/thomasgl/bin/bun
  Browsers:
    Chromium: 133.0.6943.98
  npmPackages:
    svelte: ^5.28.2 => 5.28.2

Severity

annoyance

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