public/protectedProcedure returns `any` in client usage
Environment: Node v23.3.0 pnpm
Problem:
hey all, i'm having trouble with defining base procedures for my app..
whenever i call a tRPC prodecure that uses a custom
publicProcedure
or protectedProcedure
method on the client, the types on that procedure are any
instead of the types returned by t.procedure
.
for instance, app.helloWorld.protected_getName
will be any
on the client, but is fully typed on the server.
code in the next msg:2 Replies
right now the only workaround to this is to define all my routers directly where my AppRouter lives
(i.e.:
here are my
public
/privateProcedure
(s):
here is a router using these procedures:
here's the client code where the types are incorrectly returned as any
Solution