Skip to content

reactive variable using $state breaks when updated inside #await #13817

@tommasoiovane

Description

@tommasoiovane

Describe the bug

I'm trying to migrate a svelte 4 app to version 5 but it seems that updating a variable marked with $state inside an async function called by {#await fn()} breaks the component with no errors in console.

Reproduction

I created a simple playground as you can see there's no output but if you remove $state('world') and replace it by 'world' using the "old way" it works
image

Logs

No response

System Info

System:
    OS: Linux 6.11 Debian GNU/Linux 11 (bullseye) 11 (bullseye)
    CPU: (14) x64 Intel(R) Core(TM) Ultra 7 165U
    Memory: 16.04 GB / 30.05 GB
    Container: Yes
    Shell: 5.1.4 - /bin/bash
  Binaries:
    Node: 20.18.0 - /usr/local/bin/node
    Yarn: 1.22.22 - /usr/local/bin/yarn
    npm: 10.8.2 - /usr/local/bin/npm
    pnpm: 9.12.2 - /usr/local/share/npm-global/bin/pnpm
  npmPackages:
    svelte: ^5.0.5 => 5.0.5

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