-
Notifications
You must be signed in to change notification settings - Fork 3.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
aws-cdk-lib: Missing tags when synthesizing after bundling code with esbuild #26169
Comments
I think I figured out the issue, and I'm not sure if it should be considered a CDK bug or not. Bundling the code using the esbuild option I believe this is the offending function, which was introduced in v2.81.0: aws-cdk/packages/aws-cdk-lib/core/lib/tag-manager.ts Lines 302 to 305 in 1130fab
It's comparing the constructor name to a static string to determine if the construct is taggable. I would assume this won't work if the bundler has renamed the class. In my case it's renamed to |
Thank you for your detailed report. We will discuss with the team. |
Caused by a check for `constructor.name` which `esbuild` may rename. Replace with a checkable symbol. Closes #26169.
Caused by a check for `constructor.name` which `esbuild` may rename. Replace with a checkable symbol. Closes #26169. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
Describe the bug
When using esbuild to bundle aws-cdk-lib, tags are no longer added to child nodes of a stack when using
Tags.of(stack).add(...)
since version 2.81.0 of aws-cdk-lib.Expected Behavior
should apply the TestTag tag to all taggable child constructs of the stack, whether the code is being bundled or just transpiled.
Current Behavior
No tags are applied to any child constructs.
Reproduction Steps
See https://github.com/Nevon/aws-cdk-repro-26169 for a way to reproduce the issue. The repo creates an app and a stack, adds a few resources and then adds a tag to the stack, after which the template is synthesized. When running with
ts-node
the template has tags. When running after transpiling and bundling usingesbuild
, the template does not have any tags.Possible Solution
No response
Additional Information/Context
No response
CDK CLI Version
2.80.1
Framework Version
No response
Node.js Version
v18.15.0
OS
Linux / Mac
Language
Typescript
Language Version
5.1.3
Other information
No response
The text was updated successfully, but these errors were encountered: