Canary useUtils and createTRPCQueryUtils type not callable
Trying to access utils object in my application after using
useUtils
or createTRPCQueryUtils
and getting the following type error:
Solution:Jump to solution
Figured this out, was to do with me exporting the server types and importing them on the client. Added a path override similar to what is done in the trpc project to just grab the AppRouter type from the typescript files rather than the generated declaration.
8 Replies
are you using
next
?I am indeed 🙂
thanks, I'll take a look at my deps
look at the top of the readme of https://github.com/trpc/trpc/tree/next
haha
feel free to do a PR to https://github.com/trpc/trpc/blob/next/.wip/changes.md noting your changes so we remember to put it in the blog post later 🙂
Solution
Figured this out, was to do with me exporting the server types and importing them on the client. Added a path override similar to what is done in the trpc project to just grab the AppRouter type from the typescript files rather than the generated declaration.