Kranga
All my mutations are failing due to an empty body after upgrading to 11.0.0-rc.362
TRPCError: JSON Parse error: Unexpected EOF\n at new TRPCError (/mnt/c/Users/Ángel/IdeaProjects/back/node_modules/.pnpm/@trpc+server@11.0.0-rc.362/node_modules/@trpc/server/dist/unstable-core-do-not-import/error/TRPCError.mjs:51:12)\n at <anonymous> (/mnt/c/Users/Ángel/IdeaProjects/back/node_modules/.pnpm/@trpc+server@11.0.0-rc.362/node_modules/@trpc/server/dist/unstable-core-do-not-import/http/contentType.mjs:23:30)\n at processTicksAndRejections (:12:39)
I have tried debugging in http/contentType.mjs
and I found the request body is coming empty even if it shows a body on the browser devtools.
Originally happened after upgrading a lot of rc.xxx versions at once but I pinpointed it on rc.362. The mutation works fine on rc.361 even using rc.364 on the client.
I am using bun as the runtime.2 replies
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.4 replies
Is it possible to call a query from another query defined in the same router?
Say I have some code like the following:
Is it posible to reuse the
compute_one
query logic within the compute_all
query without extracting the common logic outside the router?
I have tried doing it via instantiating a client using that same router and executing the query as usual from within the query but I get 'default' implicitly has type 'any' because it does not have a type annotation and is referenced directly or indirectly in its own initializer.
due to the router=>client=>router circular reference.3 replies