KrangaK
tRPC3y ago
3 replies
Kranga

Procedure return types are getting inferred as any

Hi, I just created a prisma + trpc backend which uses prisma-trpc-generator to generate trpc routers from the prisma schema.
I noticed that while procedure parameters are correctly typed the return type is not getting inferred.

This is not a monorepo-related issue since I moved my client to the server directory and the return types are inferred as TProcedure["_def"]["_config"]["transformer"] extends DefaultDataTransformer ? Serialize<TProcedure["_def"]["_output_out"]> : TProcedure["_def"]["_output_out"], a type that despite not being any behaves exactly like any, not providing any type-checks or autocompletion.

Is there any tsconfig that "just works" for trpc? I have spent so much time fiddling with my tsconfig.json and can't get it to work.
Was this page helpful?