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

[bug] error TS2339: Property X does not exist on type X #308

Open
3 tasks done
BowgartField opened this issue May 21, 2024 · 2 comments
Open
3 tasks done

[bug] error TS2339: Property X does not exist on type X #308

BowgartField opened this issue May 21, 2024 · 2 comments

Comments

@BowgartField
Copy link

BowgartField commented May 21, 2024

Checklist

  • I can reproduce this issue when running this plugin on its own.
  • I am running this plugin on .d.ts files generated by TypeScript.
  • This issue is not related to rolling up @types.

Code Snipped

import { SecretsManagerClient, GetSecretValueCommand } from "@aws-sdk/client-secrets-manager";

export const getAwsSecrets = async (region: string, secretName: string) => {
    const client = new SecretsManagerClient({ region });
    const command = new GetSecretValueCommand({ SecretId: secretName });
    const response = await client.send(command);
    const secrets = JSON.parse(response.SecretString);
    for (const key in secrets){
        if(!process.env[key]){
            let val = secrets[key].trim()
            if(val === 'false') val = false
            if(val === 'true') val = true
            process.env[key] = val
           console.log(`env ${key} loaded from AWS Secrets Manager`)
        }else{
           console.log(`env ${key} loaded from AWS but not used because it is already set`)
        }
    }
}

Error Message

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

my rollup config

const typesBundle = await rollup({
      input: `src/${pkg}/index.ts`,
      plugins: [
          json(),
          dts()
      ],
  });
await typesBundle.write({
    format: 'cjs',
    file: `dist/${pkg}/index.d.ts`
});
@heyikang
Copy link

I have the same error
image

@vonazt
Copy link

vonazt commented Nov 19, 2024

Getting a similar error:
Screenshot 2024-11-19 at 12 20 52
It was buried until changing the package manager from npm to pnpm. Any updates?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants