-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Closed
Closed
Copy link
Labels
bugThis issue is a bug.This issue is a bug.p2package/toolsRelated to AWS CDK Tools or CLIRelated to AWS CDK Tools or CLI
Description
General Issue
TypeScript compilation fails when exactOptionalPropertyTypes is set to true
The Question
Compilation fails when exactOptionalPropertyTypes is set to true.
Several other modules also have the same error.
> tsc
node_modules/aws-cdk-lib/aws-apigateway/lib/restapi.d.ts:226:31 - error TS2420: Class 'RestApiBase' incorrectly implements interface 'IRestApi'.
Types of property 'latestDeployment' are incompatible.
Type 'Deployment | undefined' is not assignable to type 'Deployment'.
Type 'undefined' is not assignable to type 'Deployment'.
226 export declare abstract class RestApiBase extends Resource implements IRestApi {
~~~~~~~~~~~
CDK CLI Version
2.13.0
Framework Version
2.13.0
Node.js Version
16.12.0
OS
macOS Big Sur
Language
Typescript
Language Version
TypeScript (4.5.5)
Other information
Most likely, replacing readonly latestDeployment?: Deployment; with readonly latestDeployment: Deployment | undefined; should fix the issue. I can try this as my first issue in the project. Please let me know if I should make a pull request.
maxholman, mpellegrini, takahashi-sdi and screendriver
Metadata
Metadata
Assignees
Labels
bugThis issue is a bug.This issue is a bug.p2package/toolsRelated to AWS CDK Tools or CLIRelated to AWS CDK Tools or CLI