Nick
tRPC 10 Mutations Firing Twice in Deployed Releases Only
ah was missing an await in a middleware call... when a middleware authorized function was firing inside a middleware without await on it, the operation would call again when that middleware finished.
3 replies
trpc.legacyRouterName.procedure "does not exist" on type CreateTRPCNextBase, runs anyway
I’ll meet you halfway on PEBCAK, as it would be helpful to see a working example of a legacy router in tRPC 10’s resources in addition to more detail in the v10 migration guide for those of us with robust v9 implementations.
15 replies
trpc.legacyRouterName.procedure "does not exist" on type CreateTRPCNextBase, runs anyway
I have a standalone query procedure on the legacy router called "health", this and all my other legacy procedures show up as the following on the
CreateTRPCNextBase
type: queries: MigrateProcedureRecord<RootConfig<{ ctx...}; errorShape: DefaultErrorShape; meta: {}; transformer: DefaultDataTransformer; }>, SwapContext<SwapContext<{}, { ...ctx }>, { ...ctx }> & Record<"health", Procedure<{ ...ctx }, { ...ctx }, {}, undefined, undefined, string, unknown, string>>
15 replies
trpc.legacyRouterName.procedure "does not exist" on type CreateTRPCNextBase, runs anyway
if I do
const allTasks = trpc['tasks']['findAll'].useQuery();
for a legacy query I don't get a type error, but that seems like a workaround rather than intended usage15 replies
trpc.legacyRouterName.procedure "does not exist" on type CreateTRPCNextBase, runs anyway
Since these legacy procedures work (e.g.
trpc.tasks.getAll
) but are not reflected in typeof appRouter
, I wonder if this is a type inference bug with mergeRouters15 replies