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 1 year 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

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

aBurmeseDev avatar May 24 '24 21:05 aBurmeseDev

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.

BowgartField avatar May 25 '24 14:05 BowgartField

~+1~

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

macstr1k3r avatar Jun 07 '24 11:06 macstr1k3r

@BowgartField Can you try the suggestion by @macstr1k3r and confirm if it resolves your issue as well?

aBurmeseDev avatar Aug 06 '24 03:08 aBurmeseDev

This issue has not received a response in 1 week. If you still think there is a problem, please leave a comment to avoid the issue from automatically closing.

github-actions[bot] avatar Sep 27 '24 00:09 github-actions[bot]

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[bot] avatar Oct 16 '24 00:10 github-actions[bot]