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.

Flat typedef: type instantiation is excessively deep and possibly infinite

See original GitHub issue

Problem in src/__spec__/flat.spec.ts:

// flat(0, iterable)
assert<{
  'depth = 0': IterableIterator<0 | 1 | 2>
  // ...
}>({
  'depth = 0': iter.flat(0, [0, 1, 2] as [0, 1, 2]), // Type instantiation is excessively deep and possibly infinite
  // ...
})

@KSXGitHub says this is an underlying issue in typescript-tuple

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
conartist6commented, May 15, 2019

I think we should follow the lead of the official typescript defs: https://github.com/microsoft/TypeScript/blob/d484163d0f8445aa7e1e7b944550922e99cf8305/lib/lib.es2019.array.d.ts#L45

I think any overload that has shouldFlat should return Iterable<any>.

The only tricky thing will be that we’ll need even more duplication than we have to support our curried/uncurried versions.

0reactions
conartist6commented, Aug 6, 2019

Fixed in 7.x

Read more comments on GitHub >

github_iconTop Results From Across the Web

Type instantiation is excessively deep and possibly infinite ...
So I tried to model an alternative ChainNode type purely based on the output types you showed in your question.
Read more >
Type instantiation is excessively deep and possibly infinite in ...
Expected behavior: No error is thrown. Actual behavior: Type instantiation is excessively deep and possibly infinite.ts(2589) error is thrown.
Read more >
TypeScript. Type instantiation is excessively deep ... - Ilya Zykin
Type instantiation is excessively deep and possibly infinite. How to fix. I've just started a migration to TypeScript. I see many unknown and...
Read more >
Jamon on Twitter: "I can't not brag about this — I solved a ...
An unintuitive error (“Type instantiation is excessively deep and possibly infinite”). Fixed by casting the type (IMessage) to the generic “ ...
Read more >
Type instantiation is excessively deep and possibly infinite ...
Getting `Type instantiation is excessively deep and possibly infinite` errors whenever I pass MongoClient as a parameter in my code after ...
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