You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
invalid bundles with semantically incorrect JavaScript are being published to npm.
following files are affected:
node_modules/aws-cdk-lib/aws-apigateway/lib/integrations/aws.js:1:512: ERROR - [JSC_THIS_BEFORE_SUPER] cannot access this before calling super()
node_modules/aws-cdk-lib/aws-apigateway/lib/integrations/http.js:1:442: ERROR - [JSC_THIS_BEFORE_SUPER] cannot access this before calling super()
node_modules/aws-cdk-lib/aws-apigateway/lib/integrations/lambda.js:1:607: ERROR - [JSC_THIS_BEFORE_SUPER] cannot access this before calling super()
node_modules/aws-cdk-lib/aws-apigateway/lib/lambda-api.js:1:452: ERROR - [JSC_THIS_BEFORE_SUPER] cannot access this before calling super()
node_modules/aws-cdk-lib/aws-apigateway/lib/restapi.js:1:1109: ERROR - [JSC_THIS_BEFORE_SUPER] cannot access this before calling super()
node_modules/aws-cdk-lib/aws-apigateway/lib/stepfunctions-api.js:1:515: ERROR - [JSC_THIS_BEFORE_SUPER] cannot access this before calling super()
node_modules/aws-cdk-lib/aws-applicationautoscaling/lib/target-tracking-scaling-policy.js:1:606: ERROR - [JSC_THIS_BEFORE_SUPER] cannot access this before calling super()
node_modules/aws-cdk-lib/aws-autoscaling/lib/target-tracking-scaling-policy.js:1:547: ERROR - [JSC_THIS_BEFORE_SUPER] cannot access this before calling super()
node_modules/aws-cdk-lib/aws-codepipeline-actions/lib/codecommit/source-action.js:1:891: ERROR - [JSC_THIS_BEFORE_SUPER] cannot access this before calling super()
node_modules/aws-cdk-lib/aws-codepipeline-actions/lib/codedeploy/ecs-deploy-action.js:1:562: ERROR - [JSC_THIS_BEFORE_SUPER] cannot access this before calling super()
node_modules/aws-cdk-lib/aws-config/lib/managed-rules.js:1:2345: ERROR - [JSC_THIS_BEFORE_SUPER] cannot access this before calling super()
node_modules/aws-cdk-lib/aws-docdb/lib/database-secret.js:1:484: ERROR - [JSC_THIS_BEFORE_SUPER] cannot access this before calling super()
node_modules/aws-cdk-lib/aws-ec2/lib/client-vpn-authorization-rule.js:1:482: ERROR - [JSC_THIS_BEFORE_SUPER] cannot access this before calling super()
node_modules/aws-cdk-lib/aws-ec2/lib/client-vpn-route.js:1:959: ERROR - [JSC_THIS_BEFORE_SUPER] cannot access this before calling super()
node_modules/aws-cdk-lib/aws-ecs/lib/ec2/ec2-service.js:1:645: ERROR - [JSC_THIS_BEFORE_SUPER] cannot access this before calling super()
node_modules/aws-cdk-lib/aws-ecs/lib/external/external-service.js:1:602: ERROR - [JSC_THIS_BEFORE_SUPER] cannot access this before calling super()
node_modules/aws-cdk-lib/aws-ecs/lib/fargate/fargate-service.js:1:603: ERROR - [JSC_THIS_BEFORE_SUPER] cannot access this before calling super()
node_modules/aws-cdk-lib/aws-eks/lib/oidc-provider.js:1:434: ERROR - [JSC_THIS_BEFORE_SUPER] cannot access this before calling super()
node_modules/aws-cdk-lib/aws-elasticloadbalancingv2/lib/alb/application-listener.js:1:1007: ERROR - [JSC_THIS_BEFORE_SUPER] cannot access this before calling super()
node_modules/aws-cdk-lib/aws-elasticloadbalancingv2/lib/alb/application-target-group.js:1:833: ERROR - [JSC_THIS_BEFORE_SUPER] cannot access this before calling super()
node_modules/aws-cdk-lib/aws-elasticloadbalancingv2/lib/nlb/network-listener.js:1:807: ERROR - [JSC_THIS_BEFORE_SUPER] cannot access this before calling super()
node_modules/aws-cdk-lib/aws-elasticloadbalancingv2/lib/nlb/network-target-group.js:1:671: ERROR - [JSC_THIS_BEFORE_SUPER] cannot access this before calling super()
node_modules/aws-cdk-lib/aws-events/lib/event-bus.js:1:916: ERROR - [JSC_THIS_BEFORE_SUPER] cannot access this before calling super()
node_modules/aws-cdk-lib/aws-kms/lib/alias.js:1:1162: ERROR - [JSC_THIS_BEFORE_SUPER] cannot access this before calling super()
node_modules/aws-cdk-lib/aws-lambda-nodejs/lib/function.js:1:628: ERROR - [JSC_THIS_BEFORE_SUPER] cannot access this before calling super()
node_modules/aws-cdk-lib/aws-rds/lib/database-secret.js:1:528: ERROR - [JSC_THIS_BEFORE_SUPER] cannot access this before calling super()
node_modules/aws-cdk-lib/aws-route53-targets/lib/api-gateway-domain-name.js:1:1234: ERROR - [JSC_THIS_BEFORE_SUPER] cannot access this before calling super()
node_modules/aws-cdk-lib/core/lib/nested-stack.js:1:879: ERROR - [JSC_THIS_BEFORE_SUPER] cannot access this before calling super()
node_modules/aws-cdk-lib/core/lib/stack.js:1:1360: ERROR - [JSC_THIS_BEFORE_SUPER] cannot access this before calling super()
I tracked it down and seems like this snippet in all of these files are causing them to throw:
Error.captureStackTrace(error,this.constructor);
some times it looks like this:
Error.captureStackTrace(error,this.bind)
which indeed does try to access this before super is called in all of those files. this JavaScript is semantically incorrect and should throw in "strict" mode.
Expected Behavior
CDK should not include semantically incorrect JavaScript.
Current Behavior
CDK includes semantically incorrect JavaScript and causes applications in "strict" mode to fail.
Reproduction Steps
npm i aws-cdk
Possible Solution
collection of stack trace should happen after super() is called.
Additional Information/Context
I caught this in cdk-web's pipeline after dependabot opened a PR with the new release.
CDK CLI Version
2.21.0 (build 3f74a81)
Framework Version
No response
Node.js Version
v16.14.2
OS
Ubuntu 18
Language
Typescript
Language Version
No response
Other information
this issue only showed up in the latest version 2.21.0
The text was updated successfully, but these errors were encountered:
…uper (#3528)
Instead of using `this.constructor`, inline the class name (which has
the same value as `this.constructor` anyway). This removes what can be
seen as a semantic issue (as it is usually illegal to refer to `this`
before having called `super` in strict mode).
Fixes#3527
---
By submitting this pull request, I confirm that my contribution is made under the terms of the [Apache 2.0 license].
[Apache 2.0 license]: https://www.apache.org/licenses/LICENSE-2.0
Comments on closed issues are hard for our team to see.
If you need more assistance, please either tag a team member or open a new issue that references this one.
If you wish to keep having a conversation with other community members under this issue feel free to do so.
Describe the bug
invalid bundles with semantically incorrect JavaScript are being published to npm.
following files are affected:
I tracked it down and seems like this snippet in all of these files are causing them to throw:
some times it looks like this:
which indeed does try to access
this
beforesuper
is called in all of those files. this JavaScript is semantically incorrect and should throw in "strict" mode.Expected Behavior
CDK should not include semantically incorrect JavaScript.
Current Behavior
CDK includes semantically incorrect JavaScript and causes applications in "strict" mode to fail.
Reproduction Steps
npm i aws-cdk
Possible Solution
collection of stack trace should happen after
super()
is called.Additional Information/Context
I caught this in cdk-web's pipeline after dependabot opened a PR with the new release.
CDK CLI Version
2.21.0 (build 3f74a81)
Framework Version
No response
Node.js Version
v16.14.2
OS
Ubuntu 18
Language
Typescript
Language Version
No response
Other information
this issue only showed up in the latest version
2.21.0
The text was updated successfully, but these errors were encountered: