generated from amazon-archives/__template_Apache-2.0
-
Notifications
You must be signed in to change notification settings - Fork 3
Open
Description
Description
When using @aws/lambda-invoke-store alongside @types/aws-lambda, TypeScript compilation fails with:
error TS2300: Duplicate identifier 'awslambda'.
Root Cause
@aws/lambda-invoke-store declares awslambda as a variable:
declare global {
var awslambda: {
InvokeStore?: InvokeStoreBase;
[key: string]: unknown;
};
}@types/aws-lambda declares awslambda as a namespace:
declare global {
namespace awslambda {
class HttpResponseStream extends Writable { ... }
}
}TypeScript does not allow both a var and namespace with the same identifier.
Reproduction
-
Create a project with both dependencies:
{ "dependencies": { "@aws-lambda-powertools/batch": "^2.29.0", "@types/aws-lambda": "8.10.159" } } -
Run
tsc- you will see the duplicate identifier error.
Proposed Solution
Change the global declaration from var to namespace to allow TypeScript declaration merging (as proposed in PR #18).
Current Workaround
Set skipLibCheck: true in tsconfig.json.
Environment
@aws/lambda-invoke-store: 0.2.1@types/aws-lambda: 8.10.159- TypeScript: 5.9.3
RoMujambit and dil-atelegdi
Metadata
Metadata
Assignees
Labels
No labels