jaredpalmer / tsdx

Zero-config CLI for TypeScript package development
https://tsdx.io
MIT License
11.2k stars 505 forks source link

TSDX build: semantic error TS2339: using 3rd party lib i18next #1165

Open hasary opened 1 year ago

hasary commented 1 year ago

Hi, am getting this error on tsdx build src/index.tsx(6,9): semantic error TS2339: Property 'init' does not exist on type 'typeof import("../node_modules/i18next/index")'. I checked /node_modules/i18next/ -> the 'init' is exported in index.d.ts. as you can see in https://github.com/i18next/i18next/blob/master/index.d.ts line 1234

Steps: npx tsdx create mylib cd mylib npm install i18next -save

index.tsx

import i18next from 'i18next';
i18next.init({
    fallbackLng: 'en',
    debug: true,
    interpolation: {
      escapeValue: false, 
    }
  })
}

npm run build (typescript) Error: C:/DEV/mylib/src/index.tsx(6,9): semantic error TS2339: Property 'init' does not exist on type 'typeof import("C:/DEV/mylib/node_modules/i18next/index")'.

hasary commented 1 year ago

https://github.com/i18next/i18next/blob/master/index.d.ts also on lines 1492 1493 and 1498 i18inext is declared and exported, as well as the init function.

tonyjaimep commented 1 year ago

Also having this issue with i18next as a peer dependency