Cant use the same router to create multiple createTRPCReact?
Im working in a monorepo where I have 2 clients consuming the same server with trpc.
both client are react app created with vite, installed the same dependencies and the same folder structure.
the latest project Ive created I literally cant create the trpc instance using the same serverRouter I am using on the other app.
is literally the same code lol
My guess is that I cant use it twice but wtf
2 Replies
you should be able to use it multiple times - probably mismatching package versions somewhere
one fix is to go through all of the
package.json
, set them to use the same versions of trpc
@trpc/react-query: ^10.21.0
=> @trpc/react-query: 10.21.0
then delete all node modules and reinstall themThank you!
I did it before post it, but didnt work. after a time it was working, probably Typescript cache or something.