Doesn't run with TypeScript 4.8.2
See original GitHub issueChecklist
- I have read Caveats documentation and didn’t find a solution for this problem there.
Bug description
TypeError: Cannot read properties of undefined (reading 'kind')
at getTypeFromTypeNodeWorker (/home/runner/work/backend-core-services/backend-core-services/services/backoffice-api/node_modules/typescript/lib/tsc.js:53060:26)
at getTypeFromTypeNode (/home/runner/work/backend-core-services/backend-core-services/services/backoffice-api/node_modules/typescript/lib/tsc.js:53057:49)
at getEffectiveTypeArgumentAtIndex (/home/runner/work/backend-core-services/backend-core-services/services/backoffice-api/node_modules/typescript/lib/tsc.js:68314:24)
at Array.<anonymous> (/home/runner/work/backend-core-services/backend-core-services/services/backoffice-api/node_modules/typescript/lib/tsc.js:50294:52)
at getMappedType (/home/runner/work/backend-core-services/backend-core-services/services/backoffice-api/node_modules/typescript/lib/tsc.js:53203:46)
at instantiateTypeWorker (/home/runner/work/backend-core-services/backend-core-services/services/backoffice-api/node_modules/typescript/lib/tsc.js:53516:24)
at instantiateTypeWithAlias (/home/runner/work/backend-core-services/backend-core-services/services/backoffice-api/node_modules/typescript/lib/tsc.js:53509:26)
at instantiateType (/home/runner/work/backend-core-services/backend-core-services/services/backoffice-api/node_modules/typescript/lib/tsc.js:53495:37)
at _loop_[15](https://github.com/doors-live/backend-core-services/runs/8193121746?check_suite_focus=true#step:8:16) (/home/runner/work/backend-core-services/backend-core-services/services/backoffice-api/node_modules/typescript/lib/tsc.js:50296:58)
at getInferredTypeParameterConstraint (/home/runner/work/backend-core-services/backend-core-services/services/backoffice-api/node_modules/typescript/lib/tsc.js:50327:[21](https://github.com/doors-live/backend-core-services/runs/8193121746?check_suite_focus=true#step:8:22))
Reproduction
Bump TypeScript dependency to 4.8.2
, and try to run the tests
Environment
- Node version: v18.4.0
- Testing lib and version:
- Typescript version: 4.8.2
- AWS SDK v3 Client mock version: 2.0.0
- AWS JS SDK libs and versions:
Issue Analytics
- State:
- Created a year ago
- Reactions:4
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Typescript [4.8.2] is adding invalid javascript for *.cjs files
When I upgrade to TypeScript 4.8.2, it now emits an extra export {} at the end ... But now, when index.cjs adds export...
Read more >Documentation - TypeScript 4.8
TypeScript 4.8 brings a series of correctness and consistency improvements under --strictNullChecks . These changes affect how intersection and union types work ......
Read more >reactjs - Why does this break in TypeScript 4.8? - Stack Overflow
This was a bug in Typescript with the 4.8.2 release. It has since been fixed in the 4.8.3 release.
Read more >The Definitive TypeScript 4.8 Guide - SitePen
Our TypeScript style guide is regularly updated to provide new information about the latest versions of TypeScript, and provides an overview ...
Read more >TypeScript Programming with Visual Studio Code
No, the TypeScript language service that ships with Visual Studio 2019 and 2022 isn't compatible with VS Code. You will need to install...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
After having another look and playing with the code a bit, it looks like my initial suspicion was wrong. The offending part of the code is not the AwsClientBehavior type, but rather Behavior::commandCalls. If you tweak the tsconfig to only build awsClientStub.ts, it will throw with the mentioned error by default, but succeed if Behavior::commandCalls is commented out.
Maybe someone can make use of this starter for an actual fix
I’m on vacation for the next 2 weeks, so I won’t be able to work on this soon. But I can review a PR if someone creates a fix.