-
-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Chakra does not compile with latest Typescript 4.3.x: Type instantiation is excessively deep #4226
Comments
I had the same error when building a chakra-ui React app with Vite as build tool using typescript 4.3.2. I downgraded to typescript@4.1.2 and I was able to successfully build the app. |
I'm running into this as well. I did find this: microsoft/TypeScript#43337, which also looks like it could be related. It's gonna take me a bit to wrap my head around the type that's causing the error ( |
I still haven't had a chance to dig into this but it's still occurring with 4.3.5. For anyone running into this, setting |
4.2.3 works ok too 馃槉. I'm also meaning to look further into this as well. |
I have the same issue. After upgrading Chakra, the project no longer compiles without downgrading TypeScript to 4.1.x. Specifically, |
Interesting, I'm not using |
This doesn't resolve the issue for me, just raising for awareness.
I've added this line as a temporary fix above the line that causes this error. In my case this was the end result.
|
please check : chakra-ui/chakra-ui#4226
I have a similar problem when using the following code:
ts(2589) in extendTheme line. |
Until this is fixed in chakra, we might want to lend support to this microsoft/TypeScript#44997 You can also hack the TS binary like this, but not tried it yet: microsoft/TypeScript#34933 (comment) |
This is due to the complex nature of typings we use in the codebase. We're going to loosen the types first then rewrite the theme extension API to provide a better API and TS experience. This will be released shortly. This is a lesson we've learned with TypeScript but it also revealed the complex nature of the API and we plan to simply it radically in coming releases. Thanks. |
Thanks! Just a side point but looks like very recently the instantiation limit was increased: microsoft/TypeScript#45025 |
Had the same issue when upgrading Nextjs with chakra-ui "1.6.4", but running |
馃悰 Bug report
When compiling a project with the new version of Typescript (4.3.2), a compilation error occurs in
@chakra-ui/react
:馃挜 Steps to reproduce
馃捇 Link to reproduction
** Looks like code sandbox cant be changed to use newer typescript :( **
馃 Expected behavior
It compiles.
馃Л Possible Solution
Theres been some changes in this version of ts about recursive types. Theres some loosely related stuff here microsoft/TypeScript#44299
馃實 System information
The text was updated successfully, but these errors were encountered: