charliephan
charliephan12mo ago

Getting type error in v11 when trying to instantiate createTRPCQueryUtils

Type 'CreateTRPCReactBase<CreateRouterInner<RootConfig<{ ctx: object; meta: object; errorShape: DefaultErrorShape; transformer: DefaultDataTransformer; }>, { allProjects: QueryProcedure<...>; project: QueryProcedure<...>; }>, unknown> & DecoratedProcedureRecord<...>' is not assignable to type '"The property 'query' in your router collides with a built-in method, rename this router or procedure on your backend." | "The property 'mutation' in your router collides with a built-in method, rename this router or procedure on your backend." | ... 6 more ... | TRPCUntypedClient<...>'.ts(2322)
createUtilityFunctions.d.ts(10, 5): The expected type comes from property 'client' which is declared here on type 'CreateQueryUtilsOptions<AnyRouter>'
Type 'CreateTRPCReactBase<CreateRouterInner<RootConfig<{ ctx: object; meta: object; errorShape: DefaultErrorShape; transformer: DefaultDataTransformer; }>, { allProjects: QueryProcedure<...>; project: QueryProcedure<...>; }>, unknown> & DecoratedProcedureRecord<...>' is not assignable to type '"The property 'query' in your router collides with a built-in method, rename this router or procedure on your backend." | "The property 'mutation' in your router collides with a built-in method, rename this router or procedure on your backend." | ... 6 more ... | TRPCUntypedClient<...>'.ts(2322)
createUtilityFunctions.d.ts(10, 5): The expected type comes from property 'client' which is declared here on type 'CreateQueryUtilsOptions<AnyRouter>'
No description
No description
1 Reply
SebasPtsch
SebasPtsch12mo ago
You need to call trpc.createClient and then put the result into the function