WaspW
Wasp3y ago
Gwaggli

@types delcarations

When i add some @types/i18next.d.ts type declarations to my client-side it works fine when running locally but when trying to build the from the build folder it does not get anything referenced in the custom typedefinition file. VSC also shows this as valid inside the source files. But once in the build output directory, it does not seem to get the declarations anymore. Eventho VSC is able to list the file when cmd+clicking on the module name inside the build error, it is marked red. does anybody have a clue why this might be the case? Also moving around the typedefinition file inside the build folder manually or adding path/typeRoot to the tsconfig inside the build folder does not have any impact :S

This is my declaration file:
import { TranslationsT } from '../translations/resources/de'
import { ParseKeys } from 'i18next'

declare module 'i18next' {
    export type DefaultNS = 'translation'
    export type Keys = ParseKeys<DefaultNS>
    interface CustomTypeOptions {
        defaultNS: DefaultNS
        resources: {
            translation: TranslationsT
        }
    }
}
Was this page helpful?