-
-
Notifications
You must be signed in to change notification settings - Fork 703
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’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[next-i18next] 9.0.8 -> 9.1.0: Type 'unknown' is not assignable to type 'never'. #869
Comments
Hey @Zerebokep, I'm investigating the issue. It's really strange though. // OK
const tt = t("foo")
toast(tt)
// NOK
toast(t("foo"))
// OK
function x(){ return 'hello' }
toast(x()) Anyway I'll push a fix :) |
@Zerebokep while I figure out the proper fix you can do write |
So, after checking the source of next-i18next, they added Still investigating what would be a proper fix and if it needs to be fixed. /**
* Due to a limitation/bug on typescript 4.1 (https://github.com/microsoft/TypeScript/issues/41406), we added
* "extends infer A ? A : never" in a few places to suppress the error "Type instantiation is excessively deep and possibly infinite."
* on cases where users have more than 22 namespaces. Once the issue is fixed, we can remove all instances of the workaround used.
*
* Reference of the bug reported: https://github.com/i18next/react-i18next/issues/1222
*/ |
Really appreciate your effort, you rock. |
Hey guys, any news regarding this issue? When will be available a version with this fix? |
next-i18next v13 seems to fix this issue. |
Thanks for the update. I'll close the issue |
My toast() calls complain about the type now, especially when using next-i18next's t():
toast(t('test.test'))
casting to string works, but isn't that pretty. Any chance to get the old behaviour back or was this a typescript optimization?
The text was updated successfully, but these errors were encountered: