Skip to content

constructs 10.4.3 loosens dependency constraints causing Typeguard 4.x upgrade and CDK warning flood #2825

Closed
aws/jsii
#4986

Description

@mjgoble

Summary

After upgrading from constructs 10.4.2 to 10.4.3, my dependency manager began pulling in
typeguard 4.x (instead of <3), which caused AWS CDK (aws-cdk-lib) to emit large numbers of
runtime warnings during cdk synth and bundling operations.

Downgrading constructs back to 10.4.2 immediately caused typeguard to be resolved
back to 2.x, and the warnings disappeared.

This suggests that constructs 10.4.3 has relaxed or altered its dependency constraints in a way
that allows jsii to resolve to a version compatible with typeguard>=4, which is currently
not fully compatible with CDK’s runtime type checking behavior.

Environment

  • Python 3.13
  • aws-cdk-lib: 2.223.0
  • jsii: resolved via constructs (1.119.0)
  • typeguard: 2.13.3 → 4.2.1 after upgrading constructs

Impact

typeguard 4.x introduces strict Protocol checking, and CDK uses many non-runtime-checkable
Protocols (IRole, IVpc, IFunction, etc.). This results in hundreds of warnings, like the following:

UserWarning: Typeguard cannot check the IRole protocol because it is a non-runtime protocol. If you would like to type check this protocol, please use @typing.runtime_checkable
  typeguard.check_type(value=value, expected_type=expected_type, collection_check_strategy=typeguard.CollectionCheckStrategy.ALL_ITEMS) # type:ignore

Activity

  1. mjgoble commented on Nov 12, 2025

    @mjgoble
    Author
  2. rix0rrr commented on Nov 19, 2025

    @rix0rrr
    Contributor

    10.4.2

    • released Oct 14, 2024
    • built with jsii-pacmak 1.102.0
      • typeguard dependency 'typeguard~=2.13.3',

    10.4.3

    • Released Nov 6, 2025
    • built with jsii-pacmak 1.118.0 (released July '24)
      • typeguard dependency 'typeguard>=2.13.3,<4.3.0',
  3. mrgrain commented on Nov 19, 2025

    @mrgrain
    Collaborator

    Fix is not yet released. Keeping open.

  4. otaviomacedo commented on Dec 10, 2025

    @otaviomacedo
    Contributor

    The fix was released in version 1.120.0. @mjgoble can you confirm the fix?

  5. mrgrain commented on Dec 11, 2025

    @mrgrain
    Collaborator

    @otaviomacedo we need a constructs release for this first. I'm on it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions