Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

captureAWSv3Client doesn't work with LambdaClient #505

Closed
paul-uz opened this issue May 4, 2022 · 2 comments
Closed

captureAWSv3Client doesn't work with LambdaClient #505

paul-uz opened this issue May 4, 2022 · 2 comments
Assignees

Comments

@paul-uz
Copy link

paul-uz commented May 4, 2022

captureAWSv3Client is not compatible with the v3 LambdaClient

Screenshot 2022-05-04 at 09 45 46

Error below:

Argument of type 'LambdaClient' is not assignable to parameter of type 'Client<any, any, any>'.
  The types of 'middlewareStack.concat' are incompatible between these types.
    Type '<InputType extends ServiceInputTypes, OutputType extends ServiceOutputTypes>(from: MiddlewareStack<InputType, OutputType>) => MiddlewareStack<...>' is not assignable to type '<InputType extends any, OutputType extends any>(from: MiddlewareStack<InputType, OutputType>) => MiddlewareStack<InputType, OutputType>'.
      Types of parameters 'from' and 'from' are incompatible.
        Type 'MiddlewareStack<InputType, OutputType>' is not assignable to type 'MiddlewareStack<InputType, ServiceOutputTypes>'.
          Types of property 'addRelativeTo' are incompatible.
            Type '(middleware: MiddlewareType<InputType, OutputType>, options: RelativeMiddlewareOptions) => void' is not assignable to type '(middleware: MiddlewareType<InputType, ServiceOutputTypes>, options: RelativeMiddlewareOptions) => void'.
              Types of parameters 'middleware' and 'middleware' are incompatible.
                Type 'MiddlewareType<InputType, ServiceOutputTypes>' is not assignable to type 'MiddlewareType<InputType, OutputType>'.
                  Type 'InitializeMiddleware<InputType, ServiceOutputTypes>' is not assignable to type 'MiddlewareType<InputType, OutputType>'.
                    Type 'InitializeMiddleware<InputType, ServiceOutputTypes>' is not assignable to type 'InitializeMiddleware<InputType, OutputType>'.
                      Call signature return types 'InitializeHandler<InputType, ServiceOutputTypes>' and 'InitializeHandler<InputType, OutputType>' are incompatible.
                        Type 'Promise<InitializeHandlerOutput<ServiceOutputTypes>>' is not assignable to type 'Promise<InitializeHandlerOutput<OutputType>>'.
                          Type 'InitializeHandlerOutput<ServiceOutputTypes>' is not assignable to type 'InitializeHandlerOutput<OutputType>'.
                            Types of property 'output' are incompatible.
                              Type 'ServiceOutputTypes' is not assignable to type 'OutputType'.
                                'ServiceOutputTypes' is assignable to the constraint of type 'OutputType', but 'OutputType' could be instantiated with a different subtype of constraint 'any'.
                                  Type 'AddLayerVersionPermissionCommandOutput' is not assignable to type 'OutputType'.
                                    'AddLayerVersionPermissionCommandOutput' is assignable to the constraint of type 'OutputType', but 'OutputType' could be instantiated with a different subtype of constraint 'any'.ts(2345)
@paul-uz
Copy link
Author

paul-uz commented May 4, 2022

In the screenshot, client-dynamodb is 3.51.0 and client-lambda is 3.82.0. Updating client-dynamodb to 3.82.0 and it also errors.

Tried using client-lambda 3.51.0 and it still errors

@willarmiros
Copy link
Contributor

Hi @paul-uz, thanks for raising this. We've seen similar issues in the past, the workaround for now is to case the client type as any in the instrumentation statement: https://github.com/aws/aws-xray-sdk-node/tree/master/packages/core#capture-outgoing-aws-requests-on-a-single-client

#449 should address this but we need to think further on its impact. I'm going to close this as a duplicate of #439 for now, but we will prioritize the PR when we can to no longer require the workaround

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants