TanStackT
TanStack3y ago
3 replies
spotty-amber

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,
  });
}
Was this page helpful?