Skip to content

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

@lettucebowler

Description

@lettucebowler

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

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