Skip to content

await_reactivity_loss with $derived(await query(derivedParams)) — single query, single reactive param #15654

@Cosmicist

Description

@Cosmicist

Describe the bug

After upgrading to @sveltejs/kit@2.56.0, the documented pattern for using a remote query function with arguments throws await_reactivity_loss.

I'm not sure what's causing it, but in @sveltejs/kit@2.55.0 it works fine, so it looks like a regression.

Reproduction

StackBlitz Reproduction

Example code:

<script lang="ts">
  import { myQuery } from './my.remote'

  let { params } = $props()

  const queryParams = $derived({ type: params.type })
  const { data } = $derived(await myQuery(queryParams))
</script>

Logs

[svelte] await_reactivity_loss
Detected reactivity loss when reading `Query.#current`. This happens when state is read
in an async function after an earlier `await`
https://svelte.dev/e/await_reactivity_loss

traced at:
  result              query.svelte.js:214
  promise callback*   query.svelte.js:214
  d                   page.svelte:99+
  _page               page.svelte:97+
  <anonymous>         root.svelte:68

System Info

System:
    OS: Linux 6.19 PikaOS 4 4
    CPU: (12) x64 AMD Ryzen 5 8500G w/ Radeon 740M Graphics
    Memory: 9.39 GB / 30.43 GB
    Container: Yes
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 24.14.0 - /home/cosmicist/.nvm/versions/node/v24.14.0/bin/node
    npm: 11.9.0 - /home/cosmicist/.nvm/versions/node/v24.14.0/bin/npm
    pnpm: 10.33.0 - /home/cosmicist/.local/share/pnpm/pnpm
  Browsers:
    Chromium: 145.0.7632.75
  npmPackages:
    @sveltejs/adapter-node: ^5.5.4 => 5.5.4 
    @sveltejs/kit: 2.56.0 => 2.56.0 
    @sveltejs/vite-plugin-svelte: ^6.2.4 => 6.2.4 
    svelte: ^5.55.1 => 5.55.1 
    vite: ^7.0.4 => 7.1.6

Severity

serious, but I can work around it

Additional Information

Downgrading to @sveltejs/kit@2.55.0 serves as a workaround for the time being.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions