Skip to content

await_reactivity_loss: false positive on a synchronous read in an unrelated component (leaked global tracker) #18370

Description

@reinhard-sanz

Describe the bug

With compilerOptions.experimental.async: true, await_reactivity_loss is emitted for a synchronous state read in a component that contains no await at all.

The warning's own stack trace shows the read happening inside an ordinary synchronous derived, there is no await, no async function, and no track_reactivity_loss anywhere in the read's stack. Reactivity not actually lost; the dependency is tracked correctly and the value updates as expected.

Reproduction

https://svelte.dev/playground/7babc55d2f8c47dc99c3cde01732a509?version=5.56.1

Steps: click change a few times. await_reactivity_loss is logged for Store.#undoStack, traced to get canUndo ← Bar.svelte, even though Bar has no await and Async never reads #undoStack.

Note: this is a race in the microtask queue, so the warning count varies per click. The multiple instances and the nested queueMicrotask only widen the timing window — they aren't essential to the mechanism. A single block fired intermittently for me; the wider setup makes it reliable.

Logs

System Info

System:
    OS: macOS 26.4.1
    CPU: (14) arm64 Apple M4 Pro
    Memory: 2.09 GB / 48.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.18.0 - /Users/reinhard/.nvm/versions/node/v22.18.0/bin/node
    npm: 10.9.4 - /Users/reinhard/.nvm/versions/node/v22.18.0/bin/npm
    bun: 1.3.14 - /Users/reinhard/.bun/bin/bun
  Browsers:
    Brave Browser: 146.1.88.134
    Chrome: 148.0.7778.181
    Firefox: 151.0.2
    Safari: 26.4
  npmPackages:
    svelte: ^5.55.10 => 5.56.1

Severity

annoyance

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    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