Svelte

Remote Functions: Query data not cached if it takes no arguments

#14562

Development PR

Issue

Solved
L
lettucebowler
Sep 29, 2025, 6:40 PM

Describe the bug

Queries that are not cached don't seem to be cached correctly. Current behavior is that the client makes a fetch call to the exposed endpoint during hydration.

Currently my workaround is to make the query take an argument of v.object({}), and just ignore it. This does require me to call the query everywhere with an argument of {}, but that's only a minor annoyance.

Reproduction

https://stackblitz.com/edit/sveltejs-kit-template-default-yk4grqnj?file=src%2Froutes%2Fremote.remote.ts

Logs

System Info

System:
    OS: Linux 6.14 Ubuntu 25.04 25.04 (Plucky Puffin)
    CPU: (12) x64 Intel(R) Core(TM) i7-10750H CPU @ 2.60GHz
    Memory: 23.19 GB / 30.59 GB
    Container: Yes
    Shell: 5.9 - /usr/bin/zsh
  Binaries:
    Node: 24.5.0 - ~/.volta/tools/image/node/24.5.0/bin/node
    npm: 11.5.1 - ~/.volta/tools/image/node/24.5.0/bin/npm
    pnpm: 10.14.0 - ~/.volta/bin/pnpm
    bun: 1.2.2 - ~/.bun/bin/bun

Severity

serious, but I can work around it

Additional Information

No response

Info

Closed at Sep 30, 2025, 7:54 AM
Assignees None
Labels None
Milestone None

Pro tip: You can prefix GitHub URLs of issues, PRs or discussions with svcl.dev/ to view them on this page! Also try it on a GitHub release ;)