-
Notifications
You must be signed in to change notification settings - Fork 387
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
[Typescript] CompiledMessageToken type doesn't play well with imported catalog. #1460
Comments
Typescript infers the type I believe the message is something like this |
Can we also get this warning fixed? warning "workspace-aggregator-c7800d1b-27a7-41b4-b29b-317c787b474d > app > @lingui/[email protected]" has incorrect peer dependency **"typescript@2 || 3 || 4".** TS released v5 :) |
Currently, we have the Could you please check if this is still relevant in this version? The latest version for now is |
Actually, maybe it will be fixed if I recompile the messages. But I'm not able to because of the @lingui/macro issue :( |
@vddgil show the snippet which macro could not proceed, please |
Hello @thekip, Here is a Gist of the problematic message.js file https://gist.github.com/vddgil/adb44581a952755b5cc1c3ec8cd479fc Thanks a lot! |
Same issue. In the very short term I've just changed our import { i18n } from '@lingui/core';
import { messages as enMessages } from 'locales/en/messages';
import { messages as esMessages } from 'locales/es/messages';
import { en, es } from 'make-plural/plurals';
[
{ locale: 'en', messages: enMessages, plurals: en },
{ locale: 'es', messages: esMessages, plurals: es },
].forEach(({ locale, messages, plurals }) => {
i18n.loadLocaleData(locale, { plurals });
// @ts-expect-error Lingui introduced a type error in the CompiledMessage that needs string[] as a possible type of the value in the Record
i18n.load(locale, messages);
});
i18n.activate('en'); |
guys, just cast it to any. Not a big deal. I would not recommend to use |
Describe the bug
I get type errors when trying to use my message catalogs.
To Reproduce
For the following code
I get the following type errors
If I manually change the type
CompiledMessageToken
I can fix the error.I believe the problem was introduced here. 88ac94a#diff-7a532cc8360c9c437a7693ba2c8767f39ce5e31dd36759d63a03c33286bb63b6L22-R29
Expected behavior
No type error when using imported catalogs
The text was updated successfully, but these errors were encountered: