Skip to content
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

‼️ cli: @types/babel__traverse@7.18.3 breaks builds #23126

Closed
mrgrain opened this issue Nov 28, 2022 · 1 comment · Fixed by #23125
Closed

‼️ cli: @types/babel__traverse@7.18.3 breaks builds #23126

mrgrain opened this issue Nov 28, 2022 · 1 comment · Fixed by #23125
Labels
@aws-cdk/core Related to core CDK functionality bug This issue is a bug. p0

Comments

@mrgrain
Copy link
Contributor

mrgrain commented Nov 28, 2022

Status: RESOLVED

Projects using TypeScript <4.2 (like the ones created with cdk init are failing to compile due to a transitive dependency introducing a breaking change. This issue does not affect you if you are using a recent TypeScript version.

Possible Solutions

Any of the following options will work around this issue:

  • Pin @types/babel__traverse to 7.18.2 in devDependencies
    package.json
{
  "devDependencies": {
    "@types/babel__traverse": "7.18.2"
  }
}
  • Upgrade the TypeScript version to TS >=4.2

  • Create new apps with a AWS CDK CLI of version >=2.52.1 or >=1.81.1 or projen

Describe the bug

A recent release of @types/babel__traverse (7.18.3) updated the minimum typescript version to 4.2. If you have CDK apps created with cdk init and not upgraded the TypeScript version, the build will fail.

$npm ls @types/babel__traverse
cdk-app@0.1.0 
├── @types/babel__traverse@7.18.2
├─┬ jest@27.5.1
│ └─┬ @jest/core@27.5.1
│   └─┬ jest-snapshot@27.5.1
│     └── @types/babel__traverse@7.18.2 deduped
└─┬ ts-jest@27.1.5
  └─┬ babel-jest@27.5.1
    ├─┬ @types/babel__core@7.1.20
    │ └── @types/babel__traverse@7.18.2 deduped
    └─┬ babel-preset-jest@27.5.1
      └─┬ babel-plugin-jest-hoist@27.5.1
        └── @types/babel__traverse@7.18.2 deduped

Expected Behavior

No error.

Current Behavior

When trying to build a typescript app you get the error message:

$ npm run build

node_modules/@types/babel__traverse/index.d.ts:68:50 - error TS1005: ']' expected.

68 export type ArrayKeys<T> = keyof { [P in keyof T as T[P] extends any[] ? P : never]: P };
                                                    ~~

node_modules/@types/babel__traverse/index.d.ts:68:53 - error TS1005: ';' expected.

68 export type ArrayKeys<T> = keyof { [P in keyof T as T[P] extends any[] ? P : never]: P };
                                                       ~

node_modules/@types/babel__traverse/index.d.ts:68:58 - error TS1005: ';' expected.

68 export type ArrayKeys<T> = keyof { [P in keyof T as T[P] extends any[] ? P : never]: P };
                                                            ~~~~~~~

node_modules/@types/babel__traverse/index.d.ts:68:70 - error TS1011: An element access expression should take an argument.

68 export type ArrayKeys<T> = keyof { [P in keyof T as T[P] extends any[] ? P : never]: P };
                                                                        

node_modules/@types/babel__traverse/index.d.ts:68:83 - error TS1005: ';' expected.

68 export type ArrayKeys<T> = keyof { [P in keyof T as T[P] extends any[] ? P : never]: P };
                                                                                     ~

node_modules/@types/babel__traverse/index.d.ts:68:84 - error TS1128: Declaration or statement expected.

68 export type ArrayKeys<T> = keyof { [P in keyof T as T[P] extends any[] ? P : never]: P };
                                                                                      ~

node_modules/@types/babel__traverse/index.d.ts:68:88 - error TS1128: Declaration or statement expected.

68 export type ArrayKeys<T> = keyof { [P in keyof T as T[P] extends any[] ? P : never]: P };
                                                                                          ~


Found 7 errors.

Reproduction Steps

Step 1 - create a new CDK app

cdk init --language=typescript app

Step 2 - Try to build

npm run build

Additional Information/Context

No response

CDK CLI Version

<=2.52.0
<=1.18.0

Framework Version

No response

Node.js Version

14+

OS

any

Language

Typescript

Language Version

<4.2

Other information

No response

@mrgrain mrgrain added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. p0 @aws-cdk/core Related to core CDK functionality and removed needs-triage This issue or PR still needs to be triaged. labels Nov 28, 2022
@mrgrain mrgrain changed the title @types/babel__traverse@7.18.3 breaks builds ‼️ NOTICE: @types/babel__traverse@7.18.3 breaks builds Nov 28, 2022
@mrgrain mrgrain pinned this issue Nov 28, 2022
mergify bot pushed a commit to projen/projen that referenced this issue Nov 28, 2022
Related to aws/aws-cdk#23126

---
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
@mergify mergify bot closed this as completed in #23125 Nov 28, 2022
mergify bot pushed a commit that referenced this issue Nov 28, 2022
…23125)

Fixes the compile error when running `cdk init app --language typescript && npm run build`. 

Fixes: #23126

----

### All Submissions:

* [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md)

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies)

### New Features

* [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)?
	* [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)?

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@github-actions
Copy link

⚠️COMMENT VISIBILITY WARNING⚠️

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.

mrgrain added a commit that referenced this issue Nov 28, 2022
…23125)

Fixes the compile error when running `cdk init app --language typescript && npm run build`. 

Fixes: #23126

----

### All Submissions:

* [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md)

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies)

### New Features

* [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)?
	* [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)?

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@mrgrain mrgrain changed the title ‼️ NOTICE: @types/babel__traverse@7.18.3 breaks builds ‼️ @types/babel__traverse@7.18.3 breaks builds Nov 28, 2022
@mrgrain mrgrain changed the title ‼️ @types/babel__traverse@7.18.3 breaks builds ‼️ cli: @types/babel__traverse@7.18.3 breaks builds Nov 28, 2022
mergify bot pushed a commit that referenced this issue Nov 29, 2022
…3130)

Fixes the compile error when running `cdk init app --language typescript && npm run build`.

Fixes: #23126 for v1

----

### All Submissions:

* [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md)

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies)

### New Features

* [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)?
	* [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)?

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
mrgrain added a commit that referenced this issue Nov 29, 2022
…3130)

Fixes the compile error when running `cdk init app --language typescript && npm run build`.

Fixes: #23126 for v1

----

### All Submissions:

* [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md)

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies)

### New Features

* [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)?
	* [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)?

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
mrgrain added a commit to cdklabs/aws-cdk-notices that referenced this issue Nov 30, 2022
mrgrain added a commit to cdklabs/aws-cdk-notices that referenced this issue Nov 30, 2022
brennanho pushed a commit to brennanho/aws-cdk that referenced this issue Dec 9, 2022
…ws#23125)

Fixes the compile error when running `cdk init app --language typescript && npm run build`. 

Fixes: aws#23126

----

### All Submissions:

* [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md)

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies)

### New Features

* [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)?
	* [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)?

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
@MrArnoldPalmer MrArnoldPalmer unpinned this issue Dec 15, 2022
brennanho pushed a commit to brennanho/aws-cdk that referenced this issue Jan 20, 2023
…ws#23125)

Fixes the compile error when running `cdk init app --language typescript && npm run build`. 

Fixes: aws#23126

----

### All Submissions:

* [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md)

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies)

### New Features

* [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)?
	* [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)?

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
brennanho pushed a commit to brennanho/aws-cdk that referenced this issue Feb 22, 2023
…ws#23125)

Fixes the compile error when running `cdk init app --language typescript && npm run build`. 

Fixes: aws#23126

----

### All Submissions:

* [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md)

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies)

### New Features

* [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)?
	* [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)?

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/core Related to core CDK functionality bug This issue is a bug. p0
Projects
None yet
1 participant