Google Sheets API request in NextJS App router
I'm developing a NextJS app (v14) with server components, integrating React Query.
I've set up the QueryClient Provider for SSR and client-side caching (https://tanstack.com/query/latest/docs/framework/react/guides/advanced-ssr).
When I log the request in the query function, it successfully fetches data.
My server-side component (
But, when I use the
I get this error
I've set up the QueryClient Provider for SSR and client-side caching (https://tanstack.com/query/latest/docs/framework/react/guides/advanced-ssr).
When I log the request in the query function, it successfully fetches data.
My server-side component (
layout.tsx):But, when I use the
useQuery hook in the client-side like so:I get this error
TanStack Query (FKA React Query) is often described as the missing data-fetching library for web applications, but in more technical terms, it makes fetching, caching, synchronizing and updating server state in your web applications a breeze.
Motivation
Motivation