-
Notifications
You must be signed in to change notification settings - Fork 4k
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
cdk init : tsconfig has DOM as bundled library #28428
Comments
Thanks @niko-achilles for reporting this. I can see the "dom" lib being added. |
@khushail in the meantime i have found the location of the cause, here As i can see I can contribute by correcting the code lines at the link locations mentioned. |
@niko-achilles , This PR introduced this change a long time ago and the reason for adding "DOM" is mentioned here. |
@khushail thanks for the detailed information. In my investigation important information is that the author of the See Links as reference to derive knowledge and assert the behavior: Link 2 has a note which i duplicate in this comment:
If the workerpool module is updated to v9.0.4 of the cdk repo, then the tsconfig definition in the repo of cdk may look as follows: {
"compilerOptions": {
"target": "ES2020",
"module": "commonjs",
"lib": ["es2020"],
...
},
...
} I am pinging also the contributor of the PR mentioned in your comment , @rix0rrr for better visibility and decision. Let me know if a new PR can be introduced. |
Describe the bug
When creating a cdk app by using the cli command:
cdk init sample-app --language=typescript
then a sample project is created with a tsconfig that looks as follows:DOM as declaration for lib is not needed. CDK will not executed in the DOM , so the DOM libraries should not be used when creating cdk apps.
Furthermore the package.json has as dev. dependency the
"@types/node": "20.10.4",
which is correct and can support the developer to use the typescript types defined fornode
.Expected Behavior
When creating a cdk app by using the cli command:
cdk init sample-app --language=typescript
then a sample project should be created with a tsconfig that does not have DOM as lib declaration as follows :Current Behavior
When creating a cdk app by using the cli command:
cdk init sample-app --language=typescript
then a sample project is created with a tsconfig that looks as follows:NOTE : DOM as declaration for lib is defined. CDK will not executed in the DOM , so the DOM libraries should not be used when creating cdk apps.
Reproduction Steps
cdk init sample-app --language=typescript
Possible Solution
When creating a cdk app by using the cli command:
cdk init sample-app --language=typescript
then a sample project should be created with a tsconfig that does not have DOM as lib declaration as follows :Additional Information/Context
package.json de. Dependencies should remain as is in current behavior:
CDK CLI Version
2.115.0 (build 58027ee)
Framework Version
No response
Node.js Version
v20.10.0
OS
Linux Ubuntu
Language
TypeScript
Language Version
typescript: 5.3.3
Other information
No response
The text was updated successfully, but these errors were encountered: