ortonomyO
tRPC3y ago
1 reply
ortonomy

Type errors in lambda integration

I really don't know where to start with this error.... I'm going to be integrating tRPC into a lambda, and I have a merged child router, but I'm getting this type error:

Type 'CreateRouterInner<RootConfig<{ ctx: object; meta: object; errorShape: DefaultErrorShape; transformer: DefaultDataTransformer; }>, { users: CreateRouterInner<...>; }>' is not assignable to type 'AnyRouter'.
  The types returned by 'createCaller(...)' are incompatible between these types.
    Type 'DecoratedProcedureRecord<{ users: CreateRouterInner<RootConfig<{ ctx: object; meta: object; errorShape: DefaultErrorShape; transformer: DefaultDataTransformer; }>, { ...; }>; }> & { ...; }' is not assignable to type 'DecoratedProcedureRecord<any> & { query: inferHandlerFn<any>; mutation: inferHandlerFn<any>; subscription: inferHandlerFn<any>; }'.
      Type 'DecoratedProcedureRecord<{ users: CreateRouterInner<RootConfig<{ ctx: object; meta: object; errorShape: DefaultErrorShape; transformer: DefaultDataTransformer; }>, { ...; }>; }> & { ...; }' is not assignable to type 'DecoratedProcedureRecord<any>'.
        Property 'query' is incompatible with index signature.
          Type 'inferHandlerFn<{}>' is not assignable to type 'DecoratedProcedureRecord<any> | DecorateProcedure<any>'.
            Type 'inferHandlerFn<{}>' is not assignable to type 'DecorateProcedure<any>'.
              Types of parameters 'path' and 'input' are incompatible.
                Type 'any' is not assignable to type 'never'.


I've followed the docs here: https://trpc.io/docs/server/adapters/aws-lambda to a T - anyone got any pointers?
Was this page helpful?