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

Property 'send' does not exist on type 'ACMClient' #4927

Closed
3 tasks done
uduncanu opened this issue Jul 5, 2023 · 5 comments
Closed
3 tasks done

Property 'send' does not exist on type 'ACMClient' #4927

uduncanu opened this issue Jul 5, 2023 · 5 comments
Assignees
Labels
bug This issue is a bug. p2 This is a standard priority issue

Comments

@uduncanu
Copy link

uduncanu commented Jul 5, 2023

Checkboxes for prior research

Describe the bug

Since v3.363.0, we've been getting errors when trying to list ACM certificates using code based on the example at https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/acm/command/ListCertificatesCommand/

Downgrading @aws-sdk/client-acm to v3.362.0 fixes the issue, and the only change in the release notes for 3.363.0 that looks relevant is #4873.

SDK version number

@aws-sdk/client-acm@3.363.0

Which JavaScript Runtime is this issue in?

Node.js

Details of the browser/Node.js/ReactNative version

v18.12.0

Reproduction Steps

Following the example from https://docs.aws.amazon.com/AWSJavaScriptSDK/v3/latest/client/acm/command/ListCertificatesCommand/ , we're running this code:

    var acm = new ACMClient({ region: 'us-east-1' });
    let params: ListCertificatesCommandInput = {
      CertificateStatuses: ['ISSUED'],
    };
    let certs = await acm.send(new ListCertificatesCommand(params));

Observed Behavior

This error is returned:

error TS2339: Property 'send' does not exist on type 'ACMClient'.

301       let certs = await acm.send(new ListCertificatesCommand(params));

Expected Behavior

I was expecting to not get an error, and get a list of ACM certificates.

Possible Solution

No response

Additional Information/Context

No response

@uduncanu uduncanu added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Jul 5, 2023
@RanVaknin RanVaknin self-assigned this Jul 5, 2023
@RanVaknin
Copy link
Contributor

RanVaknin commented Jul 5, 2023

Hi @uduncanu ,

Thanks for letting us know.

Unfortunately using the information provided I'm not able to reproduce the described behavior.

My code:

import { ACMClient, ListCertificatesCommand, ListCertificatesCommandInput } from "@aws-sdk/client-acm";

const acm = new ACMClient({ region: 'us-east-1' });
let params: ListCertificatesCommandInput = {
  CertificateStatuses: ['ISSUED'],
};

async function listCerts() {
  try {
      const certs = await acm.send(new ListCertificatesCommand(params));
      console.log(certs)
  } catch (error) {
      console.log(error)
  }
}
listCerts()
$ npm list
4927@1.0.0 /Users/rvaknin/test_folder/4927
├── @aws-sdk/client-acm@3.363.0
└── @types/node@20.4.0

$ tsc sample.ts
$ node sample.js
{
  '$metadata': {
    httpStatusCode: 200,
    requestId: 'REDACTED',
    extendedRequestId: undefined,
    cfId: undefined,
    attempts: 1,
    totalRetryDelay: 0
  },
  CertificateSummaryList: [
    {
      CertificateArn: 'arn:aws:acm:us-east-1:REDACTED:certificate/REDACTED',
      CreatedAt: 2023-01-18T03:01:24.864Z,
      DomainName: 'REDACTED',
      ExtendedKeyUsages: [Array],
      HasAdditionalSubjectAlternativeNames: false,
      InUse: true,
      IssuedAt: 2023-01-18T03:01:47.566Z,
      KeyAlgorithm: 'RSA-2048',
      KeyUsages: [Array],
      NotAfter: 2024-02-17T23:59:59.000Z,
      NotBefore: 2023-01-18T00:00:00.000Z,
      RenewalEligibility: 'ELIGIBLE',
      Status: 'ISSUED',
      SubjectAlternativeNameSummaries: [Array],
      Type: 'AMAZON_ISSUED'
    }
  ]
}

Can you please upload a minimal Github repository so that we can clone and test it ourselves?

Thank you!
Ran~

@RanVaknin RanVaknin added response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days. p2 This is a standard priority issue and removed needs-triage This issue or PR still needs to be triaged. labels Jul 5, 2023
@uduncanu
Copy link
Author

uduncanu commented Jul 6, 2023

Hi @RanVaknin!

I think this might be linked to the version of TypeScript. I'm playing around with the code you used and get the errors with TypeScript 3.9.4, but not with 4.9.3 or 5.1.6.

It's also worth noting that we're actually running this as part of an AWS CDK project, which created package.json for us via cdk init --language typescript. From what I can tell, once that file has been created nothing on the CDK side ever updates it. The upgrade from v3 to v4 happened in early December last year, and we created the project before then.

Using the same code you used and this package.json file, I can replicate the error by running npm run build sample.ts.

{
  "name": "bug-4927",
  "version": "0.1.0",
  "scripts": {
    "build": "tsc"
  },
  "devDependencies": {
    "typescript": "~3.9.7"
  },
  "dependencies": {
    "@aws-sdk/client-acm": "^3.363.0"
  }
}

@github-actions github-actions bot removed the response-requested Waiting on additional info and feedback. Will move to \"closing-soon\" in 7 days. label Jul 7, 2023
@RanVaknin
Copy link
Contributor

Hi @uduncanu ,

We merged smithy-lang/smithy-typescript#811.

Can you tell us if this solves your issue?

Thanks,
Ran~

@Naddiseo
Copy link

Hi @uduncanu ,

We merged awslabs/smithy-typescript#811.

Can you tell us if this solves your issue?

Thanks, Ran~

I upgraded my @aws-sdk/* packages to 3.369 which seems to include @smithy/types 1.1.1 with the mentioned released, and the type problems I saw in #4928 seem to be fixed. (I've also set my package.json resolutions set @smithy/types to 1.1.1)

@github-actions
Copy link

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs and link to relevant comments in this thread.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 29, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug This issue is a bug. p2 This is a standard priority issue
Projects
None yet
Development

No branches or pull requests

3 participants