aws / aws-sdk-js-v3

Modularized AWS SDK for JavaScript.
Apache License 2.0
2.96k stars 556 forks source link

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

Open BowgartField opened 1 month ago

BowgartField commented 1 month ago

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

aBurmeseDev commented 1 month ago

Hi @BowgartField - thanks for reaching out.

Can you try deleting your node_modules and package-lock.json and try running pnpm add/install again to see if it resolves the error? Best, John

BowgartField commented 1 month ago

Hi @BowgartField - thanks for reaching out.

Can you try deleting your node_modules and package-lock.json and try running pnpm add/install again to see if it resolves the error? Best, John

Hi, I tried deleting my package node_modules + my monorepo node_modules and deleting pnpm-lock.json but it's still not working.

macstr1k3r commented 3 weeks ago

~+1~

@BowgartField I had preserverSymlinks set to true. deleted it, got me going.