Giter Club home page Giter Club logo

Comments (9)

m-radzikowski avatar m-radzikowski commented on June 27, 2024 8

Nope, ignore my previous message, I was wrong.

If you have a project with only @aws-sdk/client-sqs v3.10.0, then everything works.

But if you have multiple AWS packages in dependencies in different versions, then you will end up @aws-sdk/types dependency on the top level (if using yarn) in one of those versions. With npm it will be similar. So if you have @aws-sdk/client-sqs v3.10.0 and also for example @aws-sdk/client-dynamodb v3.5.0, then types will be incompatible for one of those.

Best what you can do is to use the same versions for all the AWS SDK dependencies.

Another solution would be to specify the @aws-sdk/types version explicitly, in the same version as the SDK you want to test. But then you will be able to write tests only for SDK libraries in the same version.

Does it solve your problem?

from aws-sdk-client-mock.

RichardBradley avatar RichardBradley commented on June 27, 2024 8

Best what you can do is to use the same versions for all the AWS SDK dependencies.

Another solution would be to specify the @aws-sdk/types version explicitly

I had this issue -- it seems that I had multiple incompatible versions of '@aws-sdk/types' installed, although I couldn't figure out why.

I spent quite a while trying to ensure that I had the same exact version installed of all my aws sdk clients, but it still remained.

In the end I installed @aws-sdk/types explicitly at the same version as my aws sdk clients, which resolved this.

(Just a note in case anyone else has the same issue)

from aws-sdk-client-mock.

alexbaileyuk avatar alexbaileyuk commented on June 27, 2024 3

It didn't but it got me thinking about the types. Turns out that I didn't have the @aws-sdk/types package at all and that was causing issues. Adding that as a dev dependency fixed the problem.

Thanks! Great package by the way! Super simple to use!

from aws-sdk-client-mock.

m-radzikowski avatar m-radzikowski commented on June 27, 2024 3

The @aws-sdk/types is a dependency of all AWS SDK clients, and it should be in the same version as the SDK client. Here is seems that for some reason a different version was installed - maybe some other dependency requested it? Anyway, good that it helped you solve the issue, please reopen in case of further problems with types.

Thanks! Great package by the way! Super simple to use!

Thank you, good to hear it!

from aws-sdk-client-mock.

m-radzikowski avatar m-radzikowski commented on June 27, 2024

Hey, I see the types in AWS SDK changed somewhere between 3.4.1 (when I last tested it) and 3.10.0 (the current one). I will work on the fix. Thanks for the report!

from aws-sdk-client-mock.

Horlando-Leao avatar Horlando-Leao commented on June 27, 2024

For me it worked by installing @aws-sdk/types in the same version of sdk packages

from aws-sdk-client-mock.

florianakos avatar florianakos commented on June 27, 2024

Anyone knows how could I resolve this issue when tsyringe tries to work with DynamoDBClient?

src/sensor-registry/event-publisher/handle.ts:41:28 - error TS2769: No overload matches this call.
  The last overload gave the following error.
    Argument of type 'typeof DynamoDBClient' is not assignable to parameter of type 'InjectionToken<DynamoDBClient>'.
      Type 'typeof DynamoDBClient' is not assignable to type 'constructor<DynamoDBClient>'.
        Types of construct signatures are incompatible.
          Type 'new (...[configuration]: [] | [DynamoDBClientConfig]) => DynamoDBClient' is not assignable to type 'new (...args: any[]) => DynamoDBClient'.
            Types of parameters '__0' and 'args' are incompatible.
              Type 'any[]' is not assignable to type '[] | [DynamoDBClientConfig]'.
                Type 'any[]' is not assignable to type '[DynamoDBClientConfig]'.
                  Target requires 1 element(s) but source may have fewer.

41         container.register(DynamoDBClient, {
                              ~~~~~~~~~~~~~~

  node_modules/tsyringe/dist/typings/types/dependency-container.d.ts:31:5
    31     register<T>(token: InjectionToken<T>, provider: constructor<T>, options?: RegistrationOptions): DependencyContainer;
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    The last overload is declared here.


from aws-sdk-client-mock.

kjahan22 avatar kjahan22 commented on June 27, 2024

Could you get a solution for this error? @florianakos ? seeing the same error after updating @aws-sdk/client-dynamodb to 3.445.0

from aws-sdk-client-mock.

hxtree avatar hxtree commented on June 27, 2024

I experience similar with CognitoIdentityProviderClient. It was saying command was incompatible type using the latest in typescript.

const command = new   SignUpCommand({
  ClientId:  await this.fetchUserPoolClientId(),
  Username: username,
  Password: password,
  UserAttributes: [
    { Name: 'email', Value: email },
    { Name: 'nickname', Value: nickname },
    { Name: 'phone_number', Value: phone_number },
],
});

await this.cognitoClient.send(command);

After downgrading '@aws-sdk/client-cognito-identity-provider' to 3.10.0 it no longer failed for type errors.

from aws-sdk-client-mock.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.