You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the provided link, there is a clear demonstration of how to perform server side data fetching in next JS using react query.
The implemntation follows the tehcniques as they are in the documentation as well. Query client provider, prefetch query, hydration and client rendering.
However, as it can be seen from the chrome dev tools (network tab), the /pokemon api call is performed in the clients side. It should be performed server side and not even appear in the network tab (client side rendered).
Describe the bug
https://stackblitz.com/github/tanstack/query/tree/main/examples/react/nextjs-app-prefetching?embed=1&theme=light&preset=node&file=src/index.tsx
In the provided link, there is a clear demonstration of how to perform server side data fetching in next JS using react query.
The implemntation follows the tehcniques as they are in the documentation as well. Query client provider, prefetch query, hydration and client rendering.
However, as it can be seen from the chrome dev tools (network tab), the /pokemon api call is performed in the clients side. It should be performed server side and not even appear in the network tab (client side rendered).
I have created my own example as well in the following link for a clearer demonstration of the issue: https://stackblitz.com/edit/stackblitz-starters-m13als5s?file=app%2Fpokemon%2Fpokemon.tsx
Is this an issue?
Your minimal, reproducible example
https://stackblitz.com/github/tanstack/query/tree/main/examples/react/nextjs-app-prefetching?embed=1&theme=light&preset=node&file=src/index.tsx
Steps to reproduce
Expected behavior
It is expected that if a developer uses the techniques mentioned above, the request to be performed on the server side and not in the client side.
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
macOS
chrome
stckblitz and locally
Tanstack Query adapter
None
TanStack Query version
5.64.2
TypeScript version
No response
Additional context
No response
The text was updated successfully, but these errors were encountered: