Closed bert-bae closed 3 years ago
Does this also happen with the newest i18next version?
//cc: @pedrodurek
That's odd, the property is optional in both dependencies, could you provide an example in Codesandbox or similar?
It looks like updating i18next to the latest works and has the correct type definitions in i18next BackendModule
for it to compile correctly with i18next-http-backend 1.2.x.
Issue was i18next type definition for 19.4.4
export interface BackendModule<TOptions = object> extends Module {
type: 'backend';
init(services: Services, backendOptions: TOptions, i18nextOptions: InitOptions): void;
read(language: string, namespace: string, callback: ReadCallback): void;
/** Save the missing translation */
create(languages: string[], namespace: string, key: string, fallbackValue: string): void; <<< Not optional
/** Load multiple languages and namespaces. For backends supporting multiple resources loading */
readMulti?(languages: string[], namespaces: string[], callback: MultiReadCallback): void;
/** Store the translation. For backends acting as cache layer */
save?(language: string, namespace: string, data: ResourceLanguage): void;
}
Fix:
🐛 Bug Report
Running
tsc
on the 1.2.5 and 1.2.6 versions to compile typescript results in the following error:There is no compilation issue for versions 1.0.x
Expected behavior
Typescript is able to compile.
Your Environment