Skip to content
Source
Sign inSign up
TanStack/query

when using preload in solidstart, the query runs again on the client #8840

Openhuseeiin(GitHub profile, opens in a new tab) opened this issue 1 comment

Describe the bug

when using preload, the query runs on the client again needlessly

export const route = {
  preload() {
    useQueryClient().prefetchQuery(query);
  },
} satisfies RouteDefinition;

Your minimal, reproducible example

https://stackblitz.com/edit/node-e9nbpmct

Steps to reproduce

open stackblitz preview in new tab

Expected behavior

when coming from an i fixed this by setting staleTime: 10 * 1000 but the bug still occurs when coming from a fresh server request.

How often does this bug happen?

Every time

Screenshots or Videos

No response

Platform

OS: Linux Browser: Chrome

Tanstack Query adapter

solid-query

TanStack Query version

^5.69.0

TypeScript version

No response

Additional context

No response

  1. birkskyum(GitHub profile, opens in a new tab) added labelspackage: solid-query

  2. Hi! @birkskyum, I'd like to work on this issue, could I get assigned? My initial read: this might be related to how onHydrated in useBaseQuery.ts gates refetchOnMount, and SolidStart's preload possibly not going through the same dehydrate/hydrate cycle as a normal SSR render. Happy to dig deeper once assigned

  3. birkskyum(GitHub profile, opens in a new tab) assignedIdhayaBastine15

Sign in to join this conversation.