rollup-plugin-dts
rollup-plugin-dts copied to clipboard
[bug] error TS2339: Property X does not exist on type X
Checklist
- [X] I can reproduce this issue when running this plugin on its own.
- [X] I am running this plugin on
.d.ts
files generated by TypeScript. - [X] 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`
});