m-radzikowski/aws-sdk-client-mock

Upgrade to AWS SKD 3.369.0 breaks mock functionality

mariuszch opened this issue · 4 comments

Checklist

  • I have read Caveats documentation and didn't find a solution for this problem there.

Bug description

Hi, updating aws sdk packages to version 3.369.0 breaks mock functionality, please see the screenshot attached.
It fails the same way for all 4 I use in my project: Dynamo, IotDataPlane, S3, STS

Looks like some type mismatch, because it works fine when I use ts-expect-error flag

image

Reproduction

const stsClientMock = mockClient(STSClient)

Environment

"@aws-sdk/client-dynamodb": "^3.369.0",
"@aws-sdk/client-iot": "^3.369.0",
"@aws-sdk/client-iot-data-plane": "^3.369.0",
"@aws-sdk/client-s3": "^3.369.0",
"@aws-sdk/client-sts": "^3.369.0",
"@aws-sdk/lib-dynamodb": "^3.369.0",
"@aws-sdk/util-stream-node": "^3.369.0",
"aws-sdk-client-mock": "^3.0.0",
hoonoh commented

I got around this by adding dependency resolutions on @smithy/smithy-client to 1.0.3.

I didn't dive deep into this, but @smithy/smithy-client released 1.0.4 about a week ago and all aws client packages had dependency on this package marked as ^1.0.3. I guess there might be breaking changes between those versions.

Hi, I had similar issues and #167 helped me.

@mariuszch lib v3.0.0 works correctly with AWS SDK 3.369.0 and above - see example: https://codesandbox.io/s/typescript-playground-export-forked-th3ng6

Please make sure all your @aws-sdk/* and @smithy/* libs are in the same version

j03w commented

in my case my dependencies have both @smithy/types 2.1 and 2.2 so as a quick hack I added @smithy/types 2.2 as dev dependencies and that solved the problem for me