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

Argument of type 'typeof S3Client' is not assignable to parameter of type 'InstanceOrClassType<Client<ServiceInputTypes, MetadataBearer, SmithyResolvedConfiguration<HttpHandlerOptions>>>'. #168

Closed
1 task done
moltar opened this issue Jun 29, 2023 · 9 comments
Labels
bug Something isn't working

Comments

@moltar
Copy link

moltar commented Jun 29, 2023

Checklist

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

Bug description

Upgrading from 3.362.0 breaks types 3.363.0.

Reproduction

Repro: Playground Link

Environment

  • Node version: 16
  • Testing lib and version: Jest
  • Typescript version: 5
  • AWS SDK v3 Client mock version: 2.2.0
  • AWS JS SDK libs and versions: 3.363.0
@moltar moltar added the bug Something isn't working label Jun 29, 2023
@air2
Copy link

air2 commented Jun 30, 2023

It looks like it has to do with the difference between __Metabearer and Metabearer, as all Output extends from __Metabearer instead of Metabearer

@rbargholz
Copy link

A fix for us was to pin all @aws-sdk/* packages to 3.362.0 in the meantime.

@m-radzikowski
Copy link
Owner

Such errors were usually a result of having different versions of aws-sdk/types installed (see https://github.com/m-radzikowski/aws-sdk-client-mock#mixed-aws-sdktypes-versions). But it's not the case here.

v3.363.0 of AWS SDK migrated many dependencies from @aws-sdk/* to @smithy/*:

Which is probably the cause here. I will investigate the possibility of moving from using @aws-sdk/types to @smithy/types, which may be the solution. But until then, yes, you have to stay on the v3.362.0.

@aka-somix
Copy link

aka-somix commented Jun 30, 2023

I am having the same issue and cannot rollback to 3.362.0 because of vulnand cannot rollback to 3.362.0 because of vulnerability issues with that version.
Do we have any idea on how much time it will need to fix this?

I am kind of in a hurry, I have a deploy on monday and I need my test suite to be all green 😭

[EDIT]
cannot rollback to 3.362.0 because of vulnand cannot rollback to 3.362.0 because of vulnerability issues
this is not correct, my bad!

@moltar
Copy link
Author

moltar commented Jun 30, 2023

@aka-somix What vulnerability issues are there with 3.362.0?

I am kind of in a hurry, I have a deploy on monday

Maybe propose a PR then? 😛

@m-radzikowski
Copy link
Owner

I am having the same issue and cannot rollback to 3.362.0 because of vulnerability issues with that version. Do we have any idea on how much time it will need to fix this?

I am kind of in a hurry, I have a deploy on monday and I need my test suite to be all green 😭

Best case scenario is I fix this during the weekend, assuming everything goes smoothly (which I kind of doubt). This is an open-source library, feel free to submit a PR.

@aka-somix
Copy link

@moltar I was just trying to get insights on this bug rather than make pressure on the resolution.
Honestly, it is way easier for me to move away from this library since I am only mocking a DDB table, given how little time I have 😄.

Anyway, I am deleting the vulnerability part on my previous comment as it is in fact incorrect and I do not want to create confusion (I was just reported incorrectly, we were upgrading from a way lower.

Thank you @m-radzikowski for the update 🙂

m-radzikowski added a commit that referenced this issue Jul 1, 2023
AWS SDK v3.363.0 migrated from @aws-sdk/types to @smithy/types. See:
- https://github.com/aws/aws-sdk-js-v3/releases/tag/v3.363.0
- aws/aws-sdk-js-v3#4873
- #168
@m-radzikowski
Copy link
Owner

It seems like changing @aws-sdk/types to @smithy/types was enough (0865065).

I've released v3.0.0 compatible with AWS SDK v3.363.0 (and hopefully above).

@moltar
Copy link
Author

moltar commented Jul 2, 2023

Thank you Maciej!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants