Skip to content

Stale form values unless query is listed in .updates() #15787

Closed

Description

@abdelfattahradwan

Describe the bug

Suppose you have a form that uses form.fields.as(type, defaultValue) where defaultValue is a property on an object resulting from a query, the form does NOT refresh the rendered values unless the query is explicitly listed in a .updates() call on the client. This applies to both query.refresh and query.set on the server.

Interestingly, not calling .updates on the client and only calling query.refresh on the server does indeed refresh the query, and everything in the UI that depends on it is updated as well, EXCEPT for the form values.

Reproduction

https://stackblitz.com/edit/forms-not-refreshing?file=README.md

  • Start the dev server.
  • Click on any of the test posts.
  • Edit some fields.
  • Click "Update"

Expected: the new values should be submitted and remain rendered in the form.

Actual: the new values are submitted, but the form values revert to the old values.

Logs

System Info

System:
    OS: Windows 11 10.0.26200
    CPU: (28) x64 Intel(R) Core(TM) i7-14700K
    Memory: 35.36 GB / 63.70 GB
  Binaries:
    Node: 24.15.0 - C:\Program Files\nodejs\node.EXE
    npm: 11.7.0 - C:\Users\Abdo\AppData\Roaming\npm\npm.CMD
    bun: 1.3.13 - C:\Users\Abdo\.bun\bin\bun.EXE
    Deno: 2.7.12 - C:\Program Files\deno\deno.EXE
  Browsers:
    Chrome: 147.0.7727.138
    Edge: Chromium (140.0.3485.81)
    Firefox: 150.0 - C:\Program Files\Mozilla Firefox\firefox.exe
    Internet Explorer: 11.0.26100.8115
  npmPackages:
    @sveltejs/adapter-node: 5.5.4 => 5.5.4 
    @sveltejs/kit: 2.59.0 => 2.59.0 
    @sveltejs/vite-plugin-svelte: 7.0.0 => 7.0.0 
    svelte: 5.55.5 => 5.55.5 
    vite: 8.0.10 => 8.0.10

Severity

serious, but I can work around it

Additional Information

No response

Activity

  1. jdgamble555 commented on May 2, 2026

    @jdgamble555

    I think this is a bigger issue where setting ANY form values are NOT reactive.

    Example:

    form.field.set(defaultValue)

    This will ONLY set the value one time.

    This is the same for:

    form.field.as(type, defaultValue)

    I would think they BOTH should compile to something that would update the values with $effect internally.

    I have created two work arounds:

    https://dev.to/jdgamble555/sveltekit-remote-functions-workaround-helpers-4k8c#3-set-initial-data

    But I'm wondering if there should be a separate issue for this other than:

    #14815

    J

  2. abdelfattahradwan commented on May 15, 2026

    @abdelfattahradwan
    Author

    I updated to Svelte 5.55.7 and SvelteKit 2.60.1 yesterday, but this issue persists.

  3. added a commit that references this issue on Jun 17, 2026
    6fbf2b6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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