-
-
Notifications
You must be signed in to change notification settings - Fork 2.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
react-query-devtools is not working in nextjs v13 #5655
Comments
Hi @SeungYn , you need to install the v5 alpha version of devtools as well!. Do your package manager equivalent of |
Hi @lachlancollins , As you said, I installed "@tanstack/react-query-devtools": "^5.0.0-alpha.72", and this time I get another error |
Continued in #5671 |
I managed to solve this simply by declaring new QueryClient outside of component: 'use client'
import { ReactNode } from "react"
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { ReactQueryDevtools } from '@tanstack/react-query-devtools'
function TanstackProvider({ children }: { children: ReactNode }) {
const queryClient = new QueryClient();
return (
<QueryClientProvider client={queryClient}>
{children}
<ReactQueryDevtools initialIsOpen={false}/>
</QueryClientProvider>
)
}
export {
TanstackProvider,
} replaced with 'use client'
import { ReactNode } from "react"
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { ReactQueryDevtools } from '@tanstack/react-query-devtools'
const queryClient = new QueryClient();
function TanstackProvider({ children }: { children: ReactNode }) {
return (
<QueryClientProvider client={queryClient}>
{children}
<ReactQueryDevtools initialIsOpen={false}/>
</QueryClientProvider>
)
}
export {
TanstackProvider,
} |
Describe the bug
react-query-devtools is not working in nextjs v13
i'm useing nextjs v13
"@tanstack/react-query": "^5.0.0-alpha.71",
"@tanstack/react-query-devtools": "^4.29.19",
but error occurs as follows "Unhandled Runtime Error
TypeError: queryClient.getQueryCache is not a function"
and It works fine without devtools
code
library
result
Your minimal, reproducible example
.
Steps to reproduce
react-query-devtools is not working in nextjs v13
i'm useing nextjs v13
"@tanstack/react-query": "^5.0.0-alpha.71",
"@tanstack/react-query-devtools": "^4.29.19",
but error occurs as follows "Unhandled Runtime Error
TypeError: queryClient.getQueryCache is not a function"
Expected behavior
react-query-devtools is not working in nextjs v13
i'm useing nextjs v13
"@tanstack/react-query": "^5.0.0-alpha.71",
"@tanstack/react-query-devtools": "^4.29.19",
but error occurs as follows "Unhandled Runtime Error
TypeError: queryClient.getQueryCache is not a function"
How often does this bug happen?
Every time
Screenshots or Videos
No response
Platform
Chrome
macOs
Tanstack Query adapter
None
TanStack Query version
v5.0.0-alpha.71
TypeScript version
v5.1.3
Additional context
No response
The text was updated successfully, but these errors were encountered: