0

Why am i getting this error?

I get this error: ⚠ Fast Refresh had to perform a full reload due to a runtime error. ⨯ features\accounts\api\use-get-accounts.ts (6:26) @ useGetAccounts ⨯ TypeError: (0 , _tanstack_react_query__WEBPACK_IMPORTED_MODULE_1__.useQuery) is not a function at useGetAccounts (./features/accounts/api/use-get-accounts.ts:11:82) at Home (page.tsx:13:114) at stringify (<anonymous>) digest: "3742211459" 4 | 5 | export const useGetAccounts = () => { > 6 | const query = useQuery({ | ^ 7 | queryKey: ['accounts'], 8 | queryFn: async () => { 9 | const response = await client.api.accounts.$get(); ⨯ features\accounts\api\use-get-accounts.ts (6:26) @ useGetAccounts ⨯ TypeError: (0 , _tanstack_react_query__WEBPACK_IMPORTED_MODULE_1__.useQuery) is not a function at useGetAccounts (./features/accounts/api/use-get-accounts.ts:11:82) at Home (page.tsx:13:114) at stringify (<anonymous>) digest: "3742211459" 4 | 5 | export const useGetAccounts = () => { > 6 | const query = useQuery({ | ^ 7 | queryKey: ['accounts'], 8 | queryFn: async () => { 9 | const response = await client.api.accounts.$get(); GET / 500 in 108ms * History restored

14th Jun 2024, 10:26 AM
Siphethuxolo Didiza
Siphethuxolo Didiza - avatar
3 Answers
+ 2
From what I can read "useQuery is not a function". Have you defined useQuery? Are you missing a character in the name?
14th Jun 2024, 5:46 PM
Ausgrindtube
Ausgrindtube - avatar
+ 1
Hi, Siphethuxolo Didiza! The error seems to be related to useQuery. However, it’s difficult to provide more specific guidance without seeing the code.
14th Jun 2024, 1:11 PM
Per Bratthammar
Per Bratthammar - avatar