Skip to content

Svelte 5: regression, read-only props make optimistic updates impossible #10084

Closed
@Thiagolino8

Description

@Thiagolino8

Describe the bug

Mutating the prop data has always been the way to make optimistic updates with sveltekit, being the way recommended by Rich himself
But because props have become read-only this is no longer possible whether using the v3/4 or V5 syntax, which will certainly break many existing apps

Reproduction

V4 compiler
V5 compiler

Logs

Error: Non-bound props cannot be mutated — to make the `todos` settable, ensure the object it is used within is bound as a prop `bind:<prop>={...}`. Fallback values can never be mutated.

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 18.18.0 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 9.4.2 - /usr/local/bin/npm
    pnpm: 8.10.5 - /usr/local/bin/pnpm
  npmPackages:
    svelte: next => 5.0.0-next.28

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