Type ‘Construct’ is not a class derived from ‘Construct’ [Fixed]

If you are getting this error type ‘Construct’ is not a class derived from ‘Construct’. in AWS CDK application. Then this article will help you to resolve this issue.

Image for post
CDK error type ‘Construct’ is not a class derived from ‘Construct’.
type 'Construct' is not a class derived from 'Construct'.

this is caused by the fact that package.json has 2 different versions of the CDK dependencies

For example

If you check here there are 2 different versions

  1. 1.55.0
  2. 1.52.0
"@aws-cdk/aws-rds": "1.55.0","@aws-cdk/core": "1.52.0",

How to fix

Just change the same version from

"@aws-cdk/aws-rds": "1.55.0","@aws-cdk/core": "1.52.0",

To

"@aws-cdk/aws-rds": "1.55.0","@aws-cdk/core": "1.55.0",

That’s it 👏👏👏

Written by

We teach & develop for startups

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store