#queryClient.prefetchQuery not prefeching on the server (Next App Router)
11 messages ยท Page 1 of 1 (latest)
But I don't get access to the data instantly on the client, i need to wait the fetch on the client and load
Is there anything wrong in my implementation ?
after 3h of debugging, i find out that it works as expected using useSuspenseQuery it wait on the server and when it renders i get the data instantly
it seems like the useQuery as the documention uses it in the advanced hydration section is incorrect, it will not use the cached data from the server and the data will be undefined until the client fetch finishes
Or i'm 100% wrong which is possible ๐
hmmm...never mind, even with useSuspenseQuery it sends a network request even with the stale time ๐ฆ
FIXED :
I was using an RPC call on the server components which returns a JSON response already, so the serialization happens 2 times. Which is incorrect and does not match with client
it should work just as well with useQuery