AWS Javascript SDK v3 does not work with jsii due to Typescript <4 dependency
:bug: Bug Report
It seems that jsii-rosetta has a dependency on Typescript 3.9.7: https://github.com/aws/jsii/blob/main/packages/jsii-rosetta/package.json#L37
This causes AWS JS SDK v3 to not work with Lambda packaging due to their issue https://github.com/aws/aws-sdk-js-v3/issues/1919
Affected Languages
- [x]
TypeScriptorJavascript - [ ]
Python - [ ]
Java - [ ] .NET (
C#,F#, ...)
General Information
- JSII Version: 1.17.1
- Platform: macOS / Github
What is the problem?
Cannot use jsii to package an AWS Lambda function in AWS CDK that refers to Lambda code that uses AWS JS SDK v3.
Verbose Log
See logs at https://github.com/markusl/cdk-ecr-image-scan-handler/runs/1710191168
node_modules/@aws-sdk/types/dist/cjs/util.d.ts:92:42 - error TS1005: ',' expected.
92 export declare type UserAgentPair = [name: string, version?: string];
Unfortunately the presence of breaking changes in TS 4.0+ makes it difficult for us to upgrade without releasing a new major version... We have considered making TypeScript a peer dependency of jsii (but this would also be a breaking change) -- however the compiler API changes between releases would make this impossible, too...
I'm also having this issue, altough with another bundled dependency ( ajv). While I see that this is a breaking change, this will just grow to be a bigger over time with more and more typescript 4 out there.
Do you have any rough plans on when you want to release a new major version which would then also upgrade to typescript 4?
I ran into this issue today with ajv and chalk as bundled dependencies
This would be addressed when we implement https://github.com/aws/aws-cdk-rfcs/pull/373, which we are currently planning.