aws-sdk-js-v3 icon indicating copy to clipboard operation
aws-sdk-js-v3 copied to clipboard

error TS2339: Property 'send' does not exist on type 'SecretsManagerClient'

Open BowgartField opened this issue 9 months ago • 4 comments

Checkboxes for prior research

Describe the bug

I'm trying to bundle @aws-sdk/client-secrets-manager into my nodeJs package with rollup. Bundling is going good but when I'm generating the type file I got this error. I'm using pnpm to manage my project.

SDK version number

@aws-sdk/client-secrets-manager@^3.583.0

Which JavaScript Runtime is this issue in?

Node.js

Details of the browser/Node.js/ReactNative version

v20.9.0

Reproduction Steps

This is the code I'm trying to bundle:

import { GetSecretValueCommand, SecretsManagerClient } from "@aws-sdk/client-secrets-manager";
export const getAwsSecrets = async (region: string, secretName: string) => {
    const client = new SecretsManagerClient({ region });
    const response = await client.send(new GetSecretValueCommand({ SecretId: secretName }));
}

Observed Behavior

TypeScript compilation fails with Property 'send' does not exist on type 'SecretsManagerClient'.

Expected Behavior

TypeScript compilation succeeds

Possible Solution

No response

Additional Information/Context

No response

BowgartField avatar May 24 '24 08:05 BowgartField