Skip to main content
The 2024 Developer Survey results are live! See the results

All Questions

0 votes
0 answers
15 views

NextJS Server Component Data Mutation

'use server'; import TirestockComponent from '@components/TirestockComponent'; import { fetchTirestock } from '@nextapi/fetchTirestock'; export default async function UsedTirestock() { const ...
Hamzah Al-Hamadani's user avatar
0 votes
0 answers
180 views

how to fetch data in Vite SSR with React?

i am currently migrating from a vite with react simple app to an SSR one, and while doing so i've countered the fetching data issue (i'm new to SSR) so i was using react query (tenstack query) to ...
Raouf Abdallah's user avatar
0 votes
0 answers
541 views

Combining SSR Prefetch with Dynamic Layouts in Next.js and React-Query

I'm working on a project using Next.js 14 and React-Query v5, focusing on a user management system with pages at /users and /users/< id >. I need to access a list of users across these pages, so ...
Marvin Ludwig's user avatar
0 votes
0 answers
89 views

Nextjs 14 + React query SSR breaking

thanks for your time reading this and for the great job on this project! I have followed the Advanced Server Rendering walkthrough to setup my project. Beforehand here is my (partial) stack: "@...
Leonardo's user avatar
  • 3,181
0 votes
0 answers
372 views

React Query V5: prefetchQuery with gcTime set to Infinity not working as expected

I'm working on a React application with custom Server-Side Rendering (SSR) implemented through Express. The app utilizes React Query V5 and I'm facing an issue with the prefetchQuery method, ...
Yama94's user avatar
  • 1
0 votes
0 answers
83 views

Is it possible to share a react query `QueryClient` between serverless functions in nextJS?

We've recently inherited a nextJS project which is making far too many API calls to prismic, and are at threat of being bumped up to an extortionate costing if we don't get on top of it. One of the ...
Dan Lincoln's user avatar
2 votes
2 answers
2k views

How to use SSR in nextjs 14 + react-query?

I did everything according to the documentation, but there is no server rendering I have created a page app/layout.tsx export default async function RootLayout({children}: {children: React.ReactNode})...
Free's user avatar
  • 43
1 vote
1 answer
573 views

react-query streaming ssr in Next.js 13

I was trying to work with react-query using Next.js 13. I used prefetchQuery+Hydrate referencing https://tanstack.com/query/v4/docs/react/guides/ssr It worked fine, but I found out that streaming ...
stakbucks's user avatar
2 votes
0 answers
706 views

getServerSideProps with react-query doesn't work (prefetchQuery)

First of all, I'm using a custom hook for react-query. The custom hooks is as follows. export const useGetUser = (id: number) => { return useQuery<User, Error>( ['useGetUser'], () =&...
skwFE's user avatar
  • 321
2 votes
0 answers
218 views

Next.js Failed to load static props (with react-query)

I saw in sentry that many users experience the error "Failed to load static props" but I don't know why, if I try to go to the same url it always works for me, Also the for the users I can ...
Caus's user avatar
  • 21
0 votes
1 answer
1k views

When re-entering same url with Link Component in Next.js, prefetchQuery doesn't fetch data (SSR)

I'm using Next.js and React Query for SSR. Everything is fine until re-entering the exact dynamic route(e.g. domain/support/guide/faq/[id]). The expected behavior is rendered query data without ...
carryon's user avatar
  • 13
6 votes
0 answers
7k views

How to use React Query v4 SSR Hydration method with Next JS 13

Next JS 13 was just released last month and totally changed the way data was fetched while also providing an alternative to the use of _app.js and _document.js with the use of the root layout.js. ...
Idris's user avatar
  • 508
-1 votes
1 answer
967 views

React query ssr TypeError: Converting circular structure to JSON

I'm following the react-query ssr documentation but I'm getting an error. What am I doing wrong? I know what is circular structure. but in the documentation everything works fine https://tanstack.com/...
user469485's user avatar
3 votes
1 answer
4k views

How to handle multiple dehydrated queries using react-query in next JS getServersideProps

I am using react-query in conjunction with Next JS getServerSideProps to fetch data before a page loads using the hydration method specified in the docs like this: // Packages import { dehydrate, ...
Idris's user avatar
  • 508
1 vote
0 answers
156 views

tRCP is fetching data again, even when it's fetched and provided in getServerSideProps

In my project I'm using NextJs and tRPC for backend calls. I wanted to fetch some data in getServerSideProps using tRPC and provide it in Page component, also using react-query state for whole ...
Zenek Wiaderko's user avatar

15 30 50 per page