aws-cdk: lambda-nodejs: RangeError: Maximum call stack size exceeded

It seems there is some fundamental change in NodejsFunction as it no longer behaves in the same way when bundling. Running existing unit tests produces a “Maximum call stack size exceeded” error.

Reproduction Steps

See example project at https://github.com/markusl/cdk-codepipeline-bitbucket-build-result-reporter/runs/1452010511 and https://github.com/markusl/cdk-ecr-image-scan-handler/runs/1452125431

FAIL test/index.test.ts (10.518 s)
  ✕ Create CodePipelineBitbucketBuildResultReporter (351 ms)

  ● Create CodePipelineBitbucketBuildResultReporter

    RangeError: Maximum call stack size exceeded
        at Array.sort (native)

What did you expect to happen?

Would expect bundling & tests to work just fine after upgrading.

Environment

  • CDK CLI Version : 1.75.0 (build 7708242)
  • Framework Version: 1.75.0
  • Node.js Version: v14.15.0
  • OS : macOS
  • Language (Version): TypeScript 4

Other


This is 🐛 Bug Report

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Reactions: 5
  • Comments: 15 (12 by maintainers)

Commits related to this issue

Most upvoted comments

@eladb @jogold I can second @matthias-pichler-warrify 's question. This is a regression from 1.74.0, which means we would happily accept a hotfix release that fixes the problem 😃

The problem here is that the issue does not make just NodeJsFunction unusable but the whole project.

Why wasn’t this included in 1.76.0 ? 😞

Unfortunately we are blocked from releasing new versions besides launches like Lambda containers during Re:Invent week.

As soon as re:invent is over we will release this.

@jogold do you have a possible workaround until this is released?