TypeError: queryClient.getMutationDefaults is not a function (it is undefined)
Hi!
There's not much code to show here, as I'm really not sure where the error actually occurs.
In my React component I have:
const { mutate } = api.story.create.useMutation();
This gives the following error:
ERROR TypeError: queryClient.getMutationDefaults is not a function (it is undefined)
Has anyone experienced the same? I can't find any good results on Google, so I guess it's not a typical issue.
The is the first mutation I've tried to do. GET queries are working just fine.1 Reply
The error happens in here
trpc/packages/react-query/src/shared/hooks/createHooksInternal.tsx
, line 347 on queryClient.getMutationDefaults
:
I'm using tRPC version 10.43.6
Nevermind. I was using a @tanstack/react-query version 5. Downgraded to 4 and everything works.