tRPCttRPC
Powered by
KrangaK
tRPC•3y 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"]
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.
tRPCJoin
Move Fast & Break Nothing. End-to-end typesafe APIs made easy.
5,015Members
Resources
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

My TRPC hooks are getting typed as `any`
segment_treeSsegment_tree / ❓-help
2y ago
Getting data as "any"
NickNNick / ❓-help
3y ago
procedure.input(z.object) is inferred as a partial (optional fields)?
medv ❄Mmedv ❄ / ❓-help
3y ago
What types of data I could return from tRPC procedure?
Bart ⚡BBart ⚡ / ❓-help
17mo ago