Skip to content

Async Svelte breaks reactivity when using preloadData #14875

@hmnd

Description

@hmnd

Describe the bug

I'm not entirely sure what's going on yet, but when I enable compilerOptions.experimental.async, reactivity in my dialog breaks. Oddly, when the preloaded data is already cached from a previous attempt, it works fine.

Reproduction

https://stackblitz.com/edit/sveltejs-kit-template-default-rtqnsjzu?file=svelte.config.js

First, try with Preload data checked, then refresh and try with it disabled. When preloadData is used, reactivity is broken in the dialog and the svelte query gets stuck on Loading....

Logs

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: 20.19.1 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 10.8.2 - /usr/local/bin/npm
    pnpm: 8.15.6 - /usr/local/bin/pnpm
  npmPackages:
    @sveltejs/adapter-auto: ^7.0.0 => 7.0.0 
    @sveltejs/kit: ^2.47.1 => 2.48.4 
    @sveltejs/vite-plugin-svelte: ^6.2.1 => 6.2.1 
    svelte: ^5.41.0 => 5.43.2 
    vite: ^7.1.10 => 7.1.12

Severity

blocking an upgrade

Additional Information

No response

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