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
- Temp fix type Because of this https://github.com/dfee/rbx/issues/116 — committed to Defite/rbx by Defite 4 years ago
@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
TypeScriptorTypeScript Reactis displayed the current TypeScript version. Click on it and selectUse workspace version. Assuming you already installed TypeScript 3.5.x :yarn add typescript@3.5.xDowngrading from typescript
3.6to3.5works around the problemI 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 componentsIt 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
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.