Open
Description
TypeScript Version: 3.2.2
Search Terms:
error TS2321: Excessive stack depth comparing types
lodash
Code
import { PartialDeep, pick } from 'lodash';
type MapFunc<T> = (data: PartialDeep<T>) => PartialDeep<T>;
function testFunc<T>(): MapFunc<T> {
return data => pick<PartialDeep<T>>(data, []) as PartialDeep<T>;
}
{
"compilerOptions": {
"target": "es2018",
"module": "commonjs",
"lib": ["es2018", "dom"],
"strict": true,
"noEmitOnError": true
}
}
Expected behavior:
This code should compile with TS 3.2 as it will with TS 3.1
Actual behavior:
Compliation fails with the following error
error TS2321: Excessive stack depth comparing types 'PartialDeep<T>' and 'PartialDeep<PartialDeep<T>>'.
Found 2 errors.
Metadata
Metadata
Assignees
Type
Projects
Milestone
Relationships
Development
No branches or pull requests
Activity
vitaliusvs commentedon Jan 19, 2019
typescript@3.2.4
C:\dev\server\node_modules\ts-node\src\index.ts:261
return new TSError(diagnosticText, diagnosticCodes)
^
TSError: ⨯ Unable to compile TypeScript:
error TS2321: Excessive stack depth comparing types 'any' and 'ListIterateeCustom<T, boolean>'.
error TS2321: Excessive stack depth comparing types 'any' and 'ObjectIterateeCustom<T[], boolean>'.
johannesschobel commentedon Jan 20, 2019
I can confirm, that this issue still persists in
TypeScript@3.2.4
..This thread, however, is a duplicate of #21592 .
This issue was introduced somehwere in 2.7.x - and has been moved from milestone to milestone to get fixed. Unfortunately, this has not been the case for now :(
gabrielbiga commentedon Feb 20, 2019
Same issue here with TypeORM. :(
error TS2321: Excessive stack depth comparing types 'any' and 'FindConditions'.
johannesschobel commentedon Feb 20, 2019
I think, the TypeORM related issue is the most common threat, why people end up in this issue here, haha ;)
vitia commentedon Mar 9, 2019
This issue is a deal breaker :-(
pleerock commentedon Mar 10, 2019
Can you guys please check it in the
0.2.15-rc.1
? (npm i typeorm@0.2.15-rc.1
)anodynos commentedon Mar 10, 2019
EDIT: it works with
npm i typescript@3.1.6
Unfortunately @pleerock I get the same with 0.2.15-rc.1 (TS 3.3.3333, ts-node: 8.0.3):
Weirdly enough it works fine with just a
$ tsc
compilation.pleerock commentedon Mar 11, 2019
The only way I could reproduce this issue is when I did
gulp package
(that does typescript compilation inside using gulp-typescript), usingtsc
is also fine to me. Then I changed some of the code (still valid typescript code, I just restructured something) and gulp compilation worked fine. I thought issue is fixed. @anodynos can you please provide some small reproduction where me (and maybe typescript team) can test this issue?anodynos commentedon Apr 18, 2019
FYI update: I hope I get this tested during Easter with latest TypeScript & ts-node and create a small reproduction repo :-)
lucianosantana commentedon Apr 24, 2019
I confirm it works with
typescript@3.1.6
. I'm using that as a temporary workaround, since we were ontypescript@3.3.4000
before. I've also tested with the latest version3.4.3
and it's still broken.For all the tests I was using
typeorm@0.2.16
31 remaining items