Closed
Description
TypeScript Version: 3.6.2
Search Terms: excessive stack depth regression comparing types function lodash
Code
tsconfig.json
:
package.json
:
{
"dependencies": {
"@types/lodash": "4.14.129",
"typescript": "3.6.2"
}
}
main.ts
:
import negate from 'lodash/negate';
Expected behavior:
Compiles
Actual behavior:
$ tsc
error TS2321: Excessive stack depth comparing types 'Function<?>' and 'Function<?>'.
Found 1 error.
This error doesn't give any helpful information for debugging.
Upgrading @types/lodash
to the latest version (4.14.138 at time of writing) seems to fix the issue.
If we disable strictNullChecks
, we get a bit more information about the error (for some reason?):
$ tsc
error TS2321: Excessive stack depth comparing types 'Function<?>' and 'Function<?>'.
node_modules/@types/lodash/ts3.1/common/common.d.ts:194:15 - error TS2589: Type instantiation is excessively deep and possibly infinite.
194 interface Object<T> extends LoDashImplicitWrapper<T> {
~~~~~~
Found 2 errors.
This did not error in TS 3.5, so I think it's a regression?
Playground Link:
Related Issues: