tRPCttRPC
Powered by
ortonomyO
tRPC•3y 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'.
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?
AWS Lambda + API Gateway Adapter | tRPC
AWS Lambda adapter
AWS Lambda + API Gateway Adapter | tRPC
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

Type safe errors?
Gary, el Pingüino ArtefactoGGary, el Pingüino Artefacto / ❓-help
14mo ago
Incorrect type errors
magicsponMmagicspon / ❓-help
3y ago
Type errors when deploying to Vercel using new client integration
FluXFFluX / ❓-help
7mo ago
Lambda WITHOUT API Gateway (Lambda Function URL)
Han MoosHHan Moos / ❓-help
3y ago