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

‼️ NOTICE: @types/[email protected] breaks builds #20319

Closed
corymhall opened this issue May 12, 2022 · 5 comments
Closed

‼️ NOTICE: @types/[email protected] breaks builds #20319

corymhall opened this issue May 12, 2022 · 5 comments
Assignees
Labels
bug This issue is a bug. p0

Comments

@corymhall
Copy link
Contributor

corymhall commented May 12, 2022

Describe the bug

A recent release of @types/prettier (2.6.1) updated the minimum typescript version from 3.7 to 4.2, which is not supported.

@types/prettier is a transitive dependency

npm explain @types/prettier                                                                                                                                                       
@types/[email protected] dev                                                                                                                                                           
node_modules/@types/prettier                                                                                                                                                        
  @types/prettier@"^2.1.5" from [email protected]                                                                                                                                
  node_modules/jest-snapshot                                                                                                                                                        
    jest-snapshot@"^27.5.1" from @jest/[email protected]                                                                                                                                  
    node_modules/@jest/core                                                                                                                                                         
      @jest/core@"^27.5.1" from [email protected]    

Expected Behavior

No error.

Current Behavior

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

node_modules/@types/prettier/index.d.ts:41:54 - error TS2315: Type 'IsTuple' is not generic.

41 type IndexProperties<T extends { length: number }> = IsTuple<T> extends true
                                                        ~~~~~~~~~~

node_modules/@types/prettier/index.d.ts:53:6 - error TS2456: Type alias 'IsTuple' circularly references itself.

53 type IsTuple<T> = T extends [] ? true : T extends [infer First, ...infer Remain] ? IsTuple<Remain> : false;
        ~~~~~~~

node_modules/@types/prettier/index.d.ts:53:65 - error TS2574: A rest element type must be an array type.

53 type IsTuple<T> = T extends [] ? true : T extends [infer First, ...infer Remain] ? IsTuple<Remain> : false;
                                                                   ~~~~~~~~~~~~~~~

node_modules/@types/prettier/index.d.ts:53:84 - error TS2315: Type 'IsTuple' is not generic.

53 type IsTuple<T> = T extends [] ? true : T extends [infer First, ...infer Remain] ? IsTuple<Remain> : false;
                                                                                      ~~~~~~~~~~~~~~~

node_modules/@types/prettier/index.d.ts:96:5 - error TS2589: Type instantiation is excessively deep and possibly infinite.

96     call<
       ~~~~

node_modules/@types/prettier/index.d.ts:131:5 - error TS2589: Type instantiation is excessively deep and possibly infinite.

131     each<
        ~~~~

node_modules/@types/prettier/index.d.ts:165:5 - error TS2589: Type instantiation is excessively deep and possibly infinite.

165     map<
        ~~~


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

Possible Solution

Pin @types/prettier to 2.6.0 in devDependencies

package.json

{
  "devDependencies": {
    "@types/prettier": "2.6.0"
  }
}

Additional Information/Context

No response

CDK CLI Version

2.24.0

Framework Version

No response

Node.js Version

16.14.0

OS

Linux

Language

Typescript

Language Version

No response

Other information

No response

@corymhall corymhall added bug This issue is a bug. p0 needs-triage This issue or PR still needs to be triaged. labels May 12, 2022
@corymhall corymhall changed the title @types/[email protected] breaks builds ‼️ NOTICE: @types/[email protected] breaks builds May 12, 2022
@corymhall corymhall pinned this issue May 12, 2022
@corymhall
Copy link
Contributor Author

Issue in DefinitelyTyped
DefinitelyTyped/DefinitelyTyped#60310

@corymhall corymhall self-assigned this May 12, 2022
@biffgaut
Copy link
Contributor

We're seeing it too.

@biffgaut
Copy link
Contributor

Any build of a brand new CDK program is breaking:

AWS/Constructs/clients
▶ md pretty

AWS/Constructs/clients
▶ cd pretty

Constructs/clients/pretty
▶ cdk init --language typescript

Applying project template app for typescript
# Welcome to your CDK TypeScript project

This is a blank project for TypeScript development with CDK.

The `cdk.json` file tells the CDK Toolkit how to execute your app.

## Useful commands

* `npm run build`   compile typescript to js
* `npm run watch`   watch for changes and compile
* `npm run test`    perform the jest unit tests
* `cdk deploy`      deploy this stack to your default AWS account/region
* `cdk diff`        compare deployed stack with current state
* `cdk synth`       emits the synthesized CloudFormation template

Initializing a new git repository...
bin/pretty.ts:18:  // env: { account: '123456789012', region: 'us-east-1' },

[ERROR] Matched one or more prohibited patterns

Possible mitigations:
- Mark false positives as allowed using: git config --add secrets.allowed ...
- Mark false positives as allowed by adding regular expressions to .gitallowed at repository's root directory
- List your configured patterns: git config --get-all secrets.patterns
- List your configured allowed patterns: git config --get-all secrets.allowed
- List your configured allowed patterns in .gitallowed at repository's root directory
- Use --no-verify if this is a one-time false positive
Unable to initialize git repository for your project.
Executing npm install...
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-url#deprecated
npm WARN deprecated [email protected]: Please see https://github.com/lydell/urix#deprecated
npm WARN deprecated [email protected]: https://github.com/lydell/resolve-url#deprecated
npm WARN deprecated [email protected]: See https://github.com/lydell/source-map-resolve#deprecated
npm WARN deprecated [email protected]: some dependency vulnerabilities fixed, support for node < 10 dropped, and newer ECMAScript syntax/features added
npm notice
npm notice New minor version of npm available! 8.3.0 -> 8.10.0
npm notice Changelog: https://github.com/npm/cli/releases/tag/v8.10.0
npm notice Run npm install -g [email protected] to update!
npm notice
✅ All done!


Constructs/clients/pretty  master ✗                                                                                         ✚ ◒
▶ npm run build

> [email protected] build
> tsc

node_modules/@types/prettier/index.d.ts:41:54 - error TS2315: Type 'IsTuple' is not generic.

41 type IndexProperties<T extends { length: number }> = IsTuple<T> extends true
                                                        ~~~~~~~~~~

node_modules/@types/prettier/index.d.ts:53:6 - error TS2456: Type alias 'IsTuple' circularly references itself.

53 type IsTuple<T> = T extends [] ? true : T extends [infer First, ...infer Remain] ? IsTuple<Remain> : false;
        ~~~~~~~

node_modules/@types/prettier/index.d.ts:53:65 - error TS2574: A rest element type must be an array type.

53 type IsTuple<T> = T extends [] ? true : T extends [infer First, ...infer Remain] ? IsTuple<Remain> : false;
                                                                   ~~~~~~~~~~~~~~~

node_modules/@types/prettier/index.d.ts:53:84 - error TS2315: Type 'IsTuple' is not generic.

53 type IsTuple<T> = T extends [] ? true : T extends [infer First, ...infer Remain] ? IsTuple<Remain> : false;
                                                                                      ~~~~~~~~~~~~~~~

node_modules/@types/prettier/index.d.ts:96:5 - error TS2589: Type instantiation is excessively deep and possibly infinite.

96     call<
       ~~~~

node_modules/@types/prettier/index.d.ts:131:5 - error TS2589: Type instantiation is excessively deep and possibly infinite.

131     each<
        ~~~~

node_modules/@types/prettier/index.d.ts:165:5 - error TS2589: Type instantiation is excessively deep and possibly infinite.

165     map<
        ~~~


Found 7 errors.

npm notice
npm notice New minor version of npm available! 8.3.0 -> 8.10.0
npm notice Changelog: https://github.com/npm/cli/releases/tag/v8.10.0
npm notice Run npm install -g [email protected] to update!
npm notice

Constructs/clients/pretty  master ✗                                                                                        ✚ ◒  ⍉
▶

Here is the package.json for the project:

{
  "name": "pretty",
  "version": "0.1.0",
  "bin": {
    "pretty": "bin/pretty.js"
  },
  "scripts": {
    "build": "tsc",
    "watch": "tsc -w",
    "test": "jest",
    "cdk": "cdk"
  },
  "devDependencies": {
    "@types/jest": "^26.0.10",
    "@types/node": "10.17.27",
    "jest": "^26.4.2",
    "ts-jest": "^26.2.0",
    "aws-cdk": "2.20.0",
    "ts-node": "^9.0.0",
    "typescript": "~3.9.7"
  },
  "dependencies": {
    "aws-cdk-lib": "2.20.0",
    "constructs": "^10.0.0",
    "source-map-support": "^0.5.16"
  }
}
Constructs/clients/pretty  master ✗                                                                                        ✚ ◒  ⍉
▶ cdk --version
2.20.0 (build 738ef49)

mergify bot pushed a commit that referenced this issue May 12, 2022
@types/prettier is a transitive dependency of `jest`. Version `2.6.1`
introduced a breaking change by increasing the minimum supported
version of typescript to `4.2`. See related issue for more information.

re #20319


----

### All Submissions:

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

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/master/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/master/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*
corymhall added a commit that referenced this issue May 12, 2022
@types/prettier is a transitive dependency of `jest`. Version `2.6.1`
introduced a breaking change by increasing the minimum supported
version of typescript to `4.2`. See related issue for more information.

re #20319


----

### All Submissions:

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

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/master/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/master/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*
corymhall added a commit that referenced this issue May 12, 2022
@types/prettier is a transitive dependency of `jest`. Version `2.6.1`
introduced a breaking change by increasing the minimum supported
version of typescript to `4.2`. See related issue for more information.

re #20319


----

### All Submissions:

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

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/master/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/master/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*
mergify bot added a commit that referenced this issue May 13, 2022
----

### All Submissions:

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

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/master/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/master/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*----

### All Submissions:

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

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/master/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/master/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*
@types/prettier is a transitive dependency of `jest`. Version `2.6.1`
introduced a breaking change by increasing the minimum supported
version of typescript to `4.2`. See related issue for more information.

re #20319


----

### All Submissions:

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

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/master/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/master/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*
corymhall added a commit to aws-samples/aws-cdk-examples that referenced this issue May 13, 2022
re aws/aws-cdk#20319

The other option is to do what is mentioned in the referenced issue and
add a devDependency for `@types/prettier`, but since it is possible to
upgrade `typescript` that seems like the better option.
mergify bot pushed a commit to aws-samples/aws-cdk-examples that referenced this issue May 13, 2022
re aws/aws-cdk#20319

The other option is to do what is mentioned in the referenced issue and
add a devDependency for `@types/prettier`, but since it is possible to
upgrade `typescript` that seems like the better option.
mergify bot pushed a commit to projen/projen that referenced this issue May 16, 2022
Addresses the issue described in aws/aws-cdk#20319

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

johnnyshankman commented May 17, 2022

+1 Had the same issue this morning.

Solved it by pinning the version to 2.6.0 in my devDependencies and suddenly no issues.

"devDependencies": {
    "@aws-cdk/assertions": "1.143.0",
    "@types/node": "10.17.27",
    "aws-cdk": "1.143.0",
    "ts-node": "^9.0.0",
    "typescript": "~3.9.7",
    "@types/prettier": "2.6.0"
  },

I previously did not have any declaration for the @types/prettier package.

Update: Having this across many of my builds and been making this same update in many places now.

aripalo added a commit to alma-cdk/openapix that referenced this issue May 18, 2022
@peterwoodworth peterwoodworth removed the needs-triage This issue or PR still needs to be triaged. label May 19, 2022
SlootSantos added a commit to SlootSantos/dns-cdk-pipeline that referenced this issue May 22, 2022
wphilipw pushed a commit to wphilipw/aws-cdk that referenced this issue May 23, 2022
@types/prettier is a transitive dependency of `jest`. Version `2.6.1`
introduced a breaking change by increasing the minimum supported
version of typescript to `4.2`. See related issue for more information.

re aws#20319


----

### All Submissions:

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

### Adding new Unconventional Dependencies:

* [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/master/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/master/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*
@madeline-k madeline-k unpinned this issue May 30, 2022
@github-actions
Copy link

github-actions bot commented Aug 2, 2022

⚠️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.

jocoandonov added a commit to jocoandonov/aws-cdk-examples that referenced this issue Oct 16, 2023
re aws/aws-cdk#20319

The other option is to do what is mentioned in the referenced issue and
add a devDependency for `@types/prettier`, but since it is possible to
upgrade `typescript` that seems like the better option.
efi-rfauzan pushed a commit to efi-rfauzan/aws-cdk-examples that referenced this issue Jul 18, 2024
re aws/aws-cdk#20319

The other option is to do what is mentioned in the referenced issue and
add a devDependency for `@types/prettier`, but since it is possible to
upgrade `typescript` that seems like the better option.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug This issue is a bug. p0
Projects
None yet
Development

No branches or pull requests

4 participants