query: react-query-devtools is not working in nextjs v13
Describe the bug
react-query-devtools is not working in nextjs v13 i’m useing nextjs v13.4.5 “@tanstack/react-query”: “^5.0.0-alpha.71”, “@tanstack/react-query-devtools”: “^5.0.0-alpha.72”,
but error occurs as follows “Attempted import error: 'template is not exported from ‘solid-js/web’ (imported as ‘template’)”
and It works fine without devtools
code
'use client';
import { ReactQueryDevtools } from '@tanstack/react-query-devtools';
import { QueryClient, QueryClientProvider } from '@tanstack/react-query';
import { ReactNode } from 'react';
export default function ReactQueryContext({
children,
}: {
children: ReactNode;
}) {
const queryClient = new QueryClient();
return (
<QueryClientProvider client={queryClient}>
{children}
<ReactQueryDevtools initialIsOpen={false} />
</QueryClientProvider>
);
}
library
result
Your minimal, reproducible example
.
Steps to reproduce
react-query-devtools is not working in nextjs v13 i’m useing nextjs v13.4.5 “@tanstack/react-query”: “^5.0.0-alpha.71”, “@tanstack/react-query-devtools”: “^5.0.0-alpha.72”,
but error occurs as follows “Attempted import error: 'template is not exported from ‘solid-js/web’ (imported as ‘template’)”
and It works fine without devtools
Expected behavior
react-query-devtools is not working in nextjs v13 i’m useing nextjs v13.4.5 “@tanstack/react-query”: “^5.0.0-alpha.71”, “@tanstack/react-query-devtools”: “^5.0.0-alpha.72”,
but error occurs as follows “Attempted import error: 'template is not exported from ‘solid-js/web’ (imported as ‘template’)”
and It works fine without devtools
How often does this bug happen?
None
Screenshots or Videos
No response
Platform
macOs
Tanstack Query adapter
None
TanStack Query version
v5.0.0-alpha.71
TypeScript version
v5.1.3
Additional context
No response
About this issue
- Original URL
- State: closed
- Created a year ago
- Reactions: 1
- Comments: 15 (5 by maintainers)
Thanks @TkDodo I created a repo and it worked fine. My issue was where I was wrapping the context in my app…
error layout:
working layout:
EDIT: in a minimal repo both these work (without clerk), just in my own repo the first layout doesnt work… I am using a Clerk auth context too which might not be playing nicely?
EDIT2: yep, once I add a clerk provider to the minimal repo I get the same error. you can find a repo below, unfortunately you’ll first need environment keys from clerk to be able to test. Updated the snippets above to reflect this.
https://github.com/JohnGemstone/next-react-query-dev-clerk-provider/blob/main/src/app/layout.tsx
@mcous a new version of all devtools packages is available!
Still getting this error in my NextJS 13 project.
I’m using:
And I also tried using the “5.0.0-alpha.82” version of devtools.
@SeungYn @mcous should be fixed in the next version without needing to install any other dependencies!
please show a reproduction, we’re in
rc.10alreadyTrue, it didn’t get bumped. I might need to change the publish config, it only looks for changes in src and package.json.
I encountered this same bug during build using:
I was able to fix the issue by adding
"solid-js": "1.6.*"as a project dependency.@tanstack/query-devtoolshas a peer dependency onsolid-js@^1.6.10(note the caret), and my environment had installedsolid-js@1.7. Apparently something about1.7isn’t compatible with whatquery-devtoolsis relying onHi @SeungYn , could I ask you to try using the following versions: