tsdx icon indicating copy to clipboard operation
tsdx copied to clipboard

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

Open hasary opened this issue 1 year ago • 2 comments

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 avatar Feb 08 '23 15:02 hasary

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.

hasary avatar Feb 08 '23 15:02 hasary

Also having this issue with i18next as a peer dependency

tonyjaimep avatar May 19 '23 20:05 tonyjaimep