Replies: 1 comment 5 replies
-
For what it's worth, this also doesn't work for me. I can clearly see https://stackblitz.com/github/mxswat/react-query-hydration-bug What I can see is that you create an unstable query client in the render function in the |
Beta Was this translation helpful? Give feedback.
5 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the bug
Using
prefetchQuery
to pre-fetch data does not work in a Next.js dynamic route.prefetchQuery
works fine in a Next.js Static route.Your minimal, reproducible example
https://codesandbox.io/p/devbox/github/mxswat/react-query-hydration-bug
Steps to reproduce
Install dependencies, and run the project using
npm run dev
Reproduction repo: https://github.com/mxswat/react-query-hydration-bug
(Attached is a video of this process below)
Expected behavior
As a user, when I visit http://localhost:3000/ I expect to see "Game Name - 1" without seeing "Loading..." (This works)
As a user, when I visit http://localhost:3000/masseffect3 I expect to see "Game Name - 1" without seeing "Loading..." (This does not work)
How often does this bug happen?
Every time
Screenshots or Videos
Screenshare.-.2024-09-10.9_55_21.AM.mp4
Platform
Operating System: Kubuntu 23.10
KDE Plasma Version: 5.27.8
KDE Frameworks Version: 5.110.0
Qt Version: 5.15.10
Kernel Version: 6.5.0-44-generic (64-bit)
Graphics Platform: X11
Processors: 12 × Intel® Core™ i7-10750H CPU @ 2.60GHz
Memory: 62.6 GiB of RAM
Graphics Processor: NVIDIA GeForce RTX 2070 with Max-Q Design/PCIe/SSE2
Manufacturer: Micro-Star International Co., Ltd.
Product Name: GS66 Stealth 10SF
System Version: REV:1.0
Browser:
Google Chrome
Version 127.0.6533.99 (Official Build) (64-bit)
Tanstack Query adapter
react-query
TanStack Query version
5.55.4
TypeScript version
5.5.4
Additional context
I found another user with a similar issue, but I haven't heard back from them https://www.reddit.com/r/nextjs/comments/1f3ht0v/nextjs_ssr_with_reactquery_dynamic_routes_not/
Beta Was this translation helpful? Give feedback.
All reactions