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

Issues with jsii and latest version of @types/jest && @types/prettier #3700

Closed
TharaldBye opened this issue Aug 10, 2022 · 2 comments
Closed
Labels
bug This issue is a bug.

Comments

@TharaldBye
Copy link

Describe the bug

Get a number of compilation errors with jsii compiler with the latest version of libraries "@types/jest": "28.1.6" and "@types/prettier": "2.7.0"

Expected Behavior

Should compile without errors.

Current Behavior

Latest version of these 2 libraries cause jsii compilation errors.
"@types/jest": "28.1.6",
"@types/prettier": "2.7.0"

node_modules/@types/jest/index.d.ts:33:29 - error TS2694: Namespace 'jest' has no exported member 'Lifecycle'.
node_modules/@types/jest/index.d.ts:37:28 - error TS2694: Namespace 'jest' has no exported member 'Describe'.
node_modules/@types/jest/index.d.ts:40:22 - error TS2694: Namespace 'jest' has no exported member 'It'.
node_modules/@types/jest/index.d.ts:46:28 - error TS2694: Namespace 'jest' has no exported member 'Expect'.
node_modules/@types/jest/index.d.ts:416:46 - error TS7039: Mapped object type implicitly has an 'any' template type.

node_modules/@types/prettier/index.d.ts:41:54 - error TS2315: Type 'IsTuple' is not generic.
node_modules/@types/prettier/index.d.ts:53:6 - error TS2456: Type alias 'IsTuple' circularly references itself.
node_modules/@types/prettier/index.d.ts:53:65 - error TS2574: A rest element type must be an array type.
node_modules/@types/prettier/index.d.ts:96:5 - error TS2589: Type instantiation is excessively deep and possibly infinite.

Reproduction Steps

Use the following dependencies:
"peerDependencies": {
"aws-cdk-lib": "2.37.0",
"constructs": ">=10.1.71"
},
"devDependencies": {
"aws-cdk-lib": "2.37.0",
"constructs": "10.1.71",
"jsii": "1.63.2",
"jsii-docgen": "7.0.67",
"jsii-pacmak": "1.63.2",
"@types/node": "18.6.5",
"@typescript-eslint/eslint-plugin": "5.33.0",
"@typescript-eslint/parser": "5.33.0",
"eslint": "8.21.0",
"eslint-config-prettier": "8.5.0",
"eslint-import-resolver-node": "0.3.6",
"eslint-import-resolver-typescript": "3.4.0",
"eslint-plugin-import": "2.26.0",
"eslint-plugin-license-header": "0.6.0",
"eslint-plugin-prettier": "4.2.1",
"jest": "28.1.3",
"jest-util": "28.1.3",
"source-map-support": "0.5.21",
"ts-node": "10.9.1",
"tslint": "6.1.3",
"typescript": "4.7.4",
"@types/jest": "28.1.1",
"@types/prettier": "2.6.0"
}

Possible Solution

Compilation works with these versions:
"@types/jest": "28.1.1",
"@types/prettier": "2.6.0"

Additional Information/Context

jsii compiler should work with latest versions.

SDK version used

See Reproduction Steps

Environment details (OS name and version, etc.)

linux

@TharaldBye TharaldBye added bug This issue is a bug. needs-triage This issue or PR still needs to be triaged. labels Aug 10, 2022
@mrgrain
Copy link
Contributor

mrgrain commented Apr 9, 2024

This was caused by jest 28 requiring use of a newer TS version which was not supported by jsii at the time. This has now been fixed with the release of modern jsii versions: https://github.com/aws/jsii-compiler

@mrgrain mrgrain closed this as completed Apr 9, 2024
@mrgrain mrgrain removed the needs-triage This issue or PR still needs to be triaged. label Apr 9, 2024
Copy link
Contributor

github-actions bot commented Apr 9, 2024

This issue is now closed. Comments on closed issues are hard for our team to see.
If you need more assistance, please open a new issue that references this one.

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.
Projects
None yet
Development

No branches or pull requests

2 participants