Open ondrejvelisek opened 1 week ago
can you please provide exact steps to reproduce? which link should be clicked?
Hi. Sure. Its here: https://peoples-budget.vercel.app/2024/odvetvi If any more info is needed, let me know.
Also updated original post to include this.
This could be due to the useQuery
that happens before the root is rendered into the shell. I'll have a closer look in a bit.
@ondrejvelisek can you please provide a minimal complete example? your application is quite big, so narrowing it down would help a lot for debugging.
@schiller-manuel Sure. There you go:
Link to deployed vercel: https://peoples-budget-git-tanstart-bug-eb5c0b-ondrejveliseks-projects.vercel.app/
Branch on github: https://github.com/ondrejvelisek/peoples-budget/tree/tanstart-bug-min-example
This is basically your Tanstack Start + Tanstack query example with bigger data.
I noticed on local dev server it works just fine.
so this can't be reproduced locally?
No. Locally it seems working. Only production build is affected.
Not sure why though. Maybe it is due to a network conditions or something related to production build?
Which project does this relate to?
Start
Describe the bug
Hi,
hope it is not a duplicate. :)
Facts
When using
TanStack Query
with preloading from Routes loader,TanStack Start
stringify query response data and sends it together with HTML document. Just at the end of<head>
section.JavaScript bundle with React component tree and hydrating functionality is at the begining of
<head>
section.<body>
with<div id="root">
comes last after<head>
.Problem
When data are very long, JS bundle is executed before data are streamed to a browser. And therefore before
<div id="root">
is present.Im getting this in browser console:
At least, I guess this is what is happening. :)
Related code:
~__root.tsx
2024/~_providers.$.tsx (child page)
client.tsx
router.tsx
ssr.tsx
Your Example Website or App
https://github.com/ondrejvelisek/peoples-budget
Steps to Reproduce the Bug or Issue
Expected behavior
I expect page got hydrated and react runs on client.
Screenshots or Videos
Platform
Additional context
No response