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
Conflicting types with i18next-fs-backend
#103
Comments
@pedrodurek Can you advice? |
@2Pacalypse- are you using them together with i18next-chained-backend? => https://github.com/i18next/i18next-chained-backend#typescript |
No, I use one on the frontend and one on the backend, so they're different configurations (but in the same project). |
Have you also tried with skipLibCheck true ? |
related: microsoft/TypeScript#33699 |
It seems to me like the current system where each backend overwrites the
That TypeScript issue might help, but I don't see it being implemented anytime soon, if ever. My suggestion would be to simply export the |
sounds reasonable... what do you think @pedrodurek ? @2Pacalypse- would you like to start a PR? |
I've made the PRs in the repos that I've been using and been able to test (other backends would probably need to be updated as well): Note that I've only changed the parts that were relevant to my use case. I'm unfamiliar with the whole codebase so I'm not sure if anything else needs to be updated. The usage looks something like this: Also, I'd like to point out that this is still a pretty bad solution to this problem, imo. I think a proper solution would be to change the API so each plugin/backend has its options defined at the same place they're initialized, instead of having a mix of all options in the i18n
.use(HttpBackend, /* http backend options */)
.use(initReactI18next, /* react i18next options */)
.init({
// common i18next options
}) |
i18next v22.2.0 |
馃悰 Bug Report
Both this library and
i18next-fs-backend
library declare a (different)BackendOptions
type for thebackend
property in thei18next
module. See these two links:https://github.com/i18next/i18next-http-backend/blob/master/index.d.ts#L125-L129
https://github.com/i18next/i18next-fs-backend/blob/master/index.d.ts#L50-L54
I don't know how you expected this to work, but the TypeScript compilation fails as soon as you have both of these libraries installed:
To Reproduce
Install both the
i18next-http-backend
andi18next-fs-backend
libraries and run TypeScript.Your Environment
The text was updated successfully, but these errors were encountered: