T
TanStack•3y ago
xenial-black

TypeError: (0 , _tanstack_react_query__WEBPACK_IMPORTED_MODULE_2__.useQuery) is not a function

Hey there, I get this error on Next 14.0.3, NextUI and ShadCN combination. I use Linux Mint. I tried Bun, Pnpm, npm... I tried changing the versions... I'm going to lose it. What could be the problem?
import { useQuery } from "@tanstack/react-query";

export const pb = new PocketBase("http://127.0.0.1:8090");
export const user = pb.authStore?.model;
export const user_id = pb.authStore?.model?.id;

export function useUser() {
useQuery({
queryKey: ["user", user_id],
queryFn: () => getUser(),
// queryFn: () => pb.authStore.model,
});
}
import { useQuery } from "@tanstack/react-query";

export const pb = new PocketBase("http://127.0.0.1:8090");
export const user = pb.authStore?.model;
export const user_id = pb.authStore?.model?.id;

export function useUser() {
useQuery({
queryKey: ["user", user_id],
queryFn: () => getUser(),
// queryFn: () => pb.authStore.model,
});
}
3 Replies
fair-rose
fair-rose•3y ago
can you show a reproduction?
xenial-black
xenial-blackOP•3y ago
I solved it after a melt down...
'use client'
//...
'use client'
//...
what more can I say...
fair-rose
fair-rose•3y ago
OMG 😦

Did you find this page helpful?