rbx: Type instantiation is excessively deep and possibly infinite.ts (2589)

Hi,

When using NavBar, I got an error in VSCode: Type instantiation is excessively deep and possibly infinite.ts(2589)

Apparently it’s linked to https://github.com/microsoft/TypeScript/issues/30188 where they recommend to use ts-toolbelt for complex types.

About this issue

  • Original URL
  • State: open
  • Created 5 years ago
  • Reactions: 8
  • Comments: 21

Commits related to this issue

Most upvoted comments

@shakib609 That’s because VSCode uses its own bundled Typescript version by default. Open your workspace and a .ts file in it. On the bottom ribbon, next to TypeScript or TypeScript React is displayed the current TypeScript version. Click on it and select Use workspace version. Assuming you already installed TypeScript 3.5.x : yarn add typescript@3.5.x

Downgrading from typescript 3.6 to 3.5 works around the problem

For what it’s worth this issue seems to have come back in TypeScript v4.x! So stay on 3.9.x!

Nevermind! The Table component chokes on 3.9.5 and 4.x 🙁

I know this is a late reply…but work around I’ve found is to use <tbody> instead of <Table.Body>

Also happens with <Button />, <Container /> and possibly more components

It is indeed better & functional with Typescript 3.9. However, with the RBX type definitions in play, my editing experience (VSCode/Intellisense) goes from zippy fast to frustratingly slow. YMMV, of course.

TypeScript 3.9 has been released, there are some changes of note here: https://www.typescriptlang.org/docs/handbook/release-notes/typescript-3-9.html#speed-improvements

Our team has been focusing on performance after observing extremely poor editing/compilation speed with packages like material-ui and styled-components

In my branch had all tests passing in TypeScript 3.8, but one error build error in the Breadcrumbs. That disappeared as soon as I moved to TS 3.9.

There were a few changes I made to update RBX to TS 3.9, but in theory the error should be gone if you update your project consuming RBX to TS 3.9

Hotfix above fixed some cases with containers but getting it on some Navbar.Item elements too now, running typescript@3.8.3. Downgrading typescript to 3.5.2 resolved the issue. Would be nice to see this fixed with new versions of typescript.