question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Excessive stack depth comparing types with TS 3.2

See original GitHub issue

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. 

Issue Analytics

  • State:open
  • Created 5 years ago
  • Reactions:33
  • Comments:25

github_iconTop GitHub Comments

34reactions
gabrielbigacommented, Feb 20, 2019

Same issue here with TypeORM. 😦

error TS2321: Excessive stack depth comparing types ‘any’ and ‘FindConditions<E>’.

14reactions
misterjohannessoncommented, Sep 2, 2019

Chiming in with the same error for new version of typeorm.

Node: v12.6.0 typeorm: v0.2.18 typescript: v3.6.2

Downgrading typescript v.3.5.3 And then using @babel/plugin-proposal-decorators for my needed 3.6 feature has worked for now.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Typescript 4.5 excessive stack depth comparing types
I want to understand the use case because a recent feature request to turn string literals to numeric literals was declined, and this...
Read more >
type-graphql/Lobby - Gitter
Well, for a projection I have to use MongoRepository, and this is blocked by the [at-loader] TS2321: Excessive stack depth comparing types ...
Read more >
Eliminating Stack Overflow by Abstract Interpretation
An important correctness criterion for software running on embedded microcontrollers is stack safety: a guarantee that the call stack does not overflow.
Read more >
CUDA C++ Programming Guide - NVIDIA Documentation Center
To avoid allocating too much memory and thus impacting system-wide performance, request the allocation parameters from the user based on the problem size....
Read more >
Three-dimensional pre-stack depth migration of receiver ...
We present a novel 3-D pre-stack Kirchhoff depth migration (PKDM) method for ... Comparison with the widely used common conversion point (CCP) stacking ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found