question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Constructs can only be used with cdk-lib 2.18.0

See original GitHub issue

Version

v1.18.4

Steps and/or minimal code example to reproduce

The peer-dependencies are specified in a way that is not working when using any cdk version higher than 2.18.0.

    "@aws-cdk/aws-apigatewayv2-alpha": "^2.18.0-alpha.0",
    "@aws-cdk/aws-appsync-alpha": "^2.18.0-alpha.0",
    "@aws-cdk/aws-redshift-alpha": "^2.18.0-alpha.0",
    "@aws-cdk/aws-synthetics-alpha": "^2.18.0-alpha.0",

These only match 2.18.0-alpha.0, 2.18.0-alpha.1, 2.18.0-alpha.2 and so on but not 2.19.0-alpha.0 or in my case 2.22.0-alpha.0

Expected behavior

Any minor version higher than 2.18.0-alpha.0 can be used.

Actual behavior

Error: Error: Declared dependency on version ^2.18.0-alpha.0 of @aws-cdk/aws-apigatewayv2-alpha, but version 2.22.0-alpha.0 was found

Other details

I couldn’t find a way to make it work with overrides or resolutions and to make it even worse there is no notation that matches 2.18.0-alpha.0 and 2.19.0-alpha.0 other than 2.18.0-alpha.0 || 2.19.0-alpha.0.

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:5
  • Comments:10 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
echeung-amzncommented, Aug 12, 2022

Is this in the context of building a construct that uses cdk-monitoring-constructs, or a CDK project that isn’t using TypeScript?

0reactions
svrielynckcommented, Nov 3, 2022

Checked the issues so far but it seems I’m forced to include all of the alpha dependencies which are currently sitting inside of the cdk-monitoring package as well even though I’m not using them

node_modules/cdk-monitoring-constructs/lib/monitoring/aws-synthetics/SyntheticsCanaryMetricFactory.d.ts(1,24): error TS2307: Cannot find module '@aws-cdk/aws-synthetics-alpha' or its corresponding type declarations.
52

After adding this particular dependency I’m not having run time failures because I don’t have the

● Test suite failed to run
--
61 |  
62 | Cannot find module '@aws-cdk/aws-redshift-alpha' from 'node_modules/cdk-monitoring-constructs/lib/facade/MonitoringAspect.js'
63 |  
64 | Require stack:
65 | node_modules/cdk-monitoring-constructs/lib/facade/MonitoringAspect.js
66 | node_modules/cdk-monitoring-constructs/lib/facade/MonitoringFacade.js
67 | node_modules/cdk-monitoring-constructs/lib/facade/index.js
68 | node_modules/cdk-monitoring-constructs/lib/index.js

is it an expected behavior ?

Read more comments on GitHub >

github_iconTop Results From Across the Web

aws-cdk-lib module
AWS Cloud Development Kit Library. The AWS CDK construct library provides APIs to define your CDK application and add CDK constructs to the...
Read more >
Unable to install pipelines library with CDK >= 2.0 · Issue ...
What is the problem? I'm trying to install aws_cdk.pipelines library in a new project that was created following the page https://docs.aws.
Read more >
The Great Migration: Upgrading CDK v1 to v2
The biggest change you will notice from v1 to v2 is the package import. Instead of having to individually bring in each construct...
Read more >
cdk-monitoring-constructs - npm package
Easy-to-use CDK constructs for monitoring your AWS infrastructure. Easily add commonly-used alarms using predefined properties; Generate concise ...
Read more >
Proper way to use AWS CDK imports
You are mixing CDK v1 and CDK v2 dependencies here. "aws-cdk-lib": "2.40.0" is CDK V2, which consolidates all the libraries into a single ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found