-
-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(solid query/trpc) does not hydrate properly #118
Comments
I think its under tanstack query because i remember facing this issue on trpc so i went back and checked what happens if i just run a query regardless of trpc, it still ran it twice. How about crate a new app and instead of using trpc just use createQuery and see if its being ran twice. If so an issue should be opened under tanstack query |
So basically at the index page instead of calling .myRouter.query.createQuery() Change it to createQuery(() => ({ queryKey, queryFn)) Directly from solid query. |
cc @ardeora
|
so basically the main issue here is not the hydration is that solid query makes 2 requests instead of 1 for some reason. |
https://stackblitz.com/github/ardeora/solid-start-query-bug-repo Could I get an isolated example with solid query that does double refetch? In this example above you can see that the request doesnt fire on client unless you switch tabs |
https://github.com/OrJDev/solid-query-bug here is a video of it actually broken. 2024-03-16.12-35-53.mp4so in the video you can see that it calls the function on both client & server, causing it to render the wrong number, even tho i just opened the page and i disabled refetchOnWindowFocus. |
Should be fixed in v5.28.5+ https://stackblitz.com/edit/github-fg2nmx?file=src%2Froutes%2Findex.tsx |
The trpc resolver is getting double-fetched, once on the server during SSR and once on client hydration.
Steps to reproduce:
src/server/trpc/router/example.ts
to:Might be a tanstack query problem (their start example works properly, but is a couple start versions behind and updating it yields errors, so I gave up)
The text was updated successfully, but these errors were encountered: