TanStackT
TanStack3y ago
30 replies
developed-pink

Unable to troubleshoot "Missing queryFn"

Hello, I not able to troubleshoot this error. I am on Nextjs 13
I have a page /profile that loads up fine the first time user logs in (router.push('/profile') onsuccess) . This page has a component ProfileMain that calls :
const { data: userData, isLoading } = useQuery(
    ["userData", userId],
    () => fetchUserData(userId),
    {
      retry: false,
      onSuccess: (data) => {
       ...
      },
      onError: (error) => {
        ...
      },
      onSettled: () => {},
    },
  ); 



I have another page /linked which has a next/Link to /profile. When clicking on this link I am routed back to /profile but I keep getting "Missing queryFn" error every few seconds

Help please?!
Was this page helpful?