TRPC NUXT req run 2 times(on server and client)
Hi everyone, I have a problem using DataCache in SSR.
I am using this function to "GET" my plan.
But every time I navigate to this page, I see an http request. It's like the data is not being cached...
11 Replies
It does another request when the data is stale, read tanstack query important defaults. If you don’t believe it’s SSRing you can validate that with the HTML in the response in your dev-tools.
yeah i think it's that, but i can't really fix this.
i have used this lib: "trpc-nuxt": "^0.10.21"
this function use 'query' to get data, and in my page i use 'usequery'
i have 1 ssr in my terminal correctly, but i still have un in chrome
You can change the default behaviour when you init the query client or on the query itself
useQuery(undefined, options)
and disable the refetch optionsThanks bro, but I think I still have the feature...if you have time, can we have a quick meeting?
Try setting the getCachedData properties in the useQuery options
https://nuxt.com/docs/api/composables/use-async-data#params
i think it's @nuxt/devalue that can not stringify the function response