Error
It appears there is a type incompatibility between the XRay and AWS-SDK libraries.
The following boilerplate code returns an error:
import { DynamoDBClient } from '@aws-sdk/client-dynamodb';
import AWSXRay from 'aws-xray-sdk-core';
const client: DynamoDBClient = AWSXRay.captureAWSv3Client(new DynamoDBClient({}));
There error is:
Argument of type 'DynamoDBClient' is not assignable to parameter of type 'Client<any, any, any>'.
Types of property 'middlewareStack' are incompatible.
Property 'identifyOnResolve' is missing in type 'MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>' but required in type 'MiddlewareStack<any, any>'.ts(2345)
Investigation
From what I've been able to assess, it seems the XRay library is using @smithy/types version ^3.3.0 (via @aws-sdk/types ^3.4.0) whereas the AWS SDK DynamoDB client library uses @smithy/types version ^1.1.0. The latter uses an additional generic parameter when declaring the Client class which seems to be the root cause of the issue.
I believe this issue is related to this one. I imagine there is a similar type incompatibility there. Not sure if this is a bug here and the version should be downgraded or if this should be raised to the AWS SDK team.
Hello,
Error It appears there is a type incompatibility between the XRay and AWS-SDK libraries. The following boilerplate code returns an error:
There error is: Argument of type 'DynamoDBClient' is not assignable to parameter of type 'Client<any, any, any>'. Types of property 'middlewareStack' are incompatible. Property 'identifyOnResolve' is missing in type 'MiddlewareStack<ServiceInputTypes, ServiceOutputTypes>' but required in type 'MiddlewareStack<any, any>'.ts(2345)
Investigation From what I've been able to assess, it seems the XRay library is using @smithy/types version ^3.3.0 (via @aws-sdk/types ^3.4.0) whereas the AWS SDK DynamoDB client library uses @smithy/types version ^1.1.0. The latter uses an additional generic parameter when declaring the Client class which seems to be the root cause of the issue.
I believe this issue is related to this one. I imagine there is a similar type incompatibility there. Not sure if this is a bug here and the version should be downgraded or if this should be raised to the AWS SDK team.
Package versions: