Skip to content
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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
hasary opened this issue Feb 8, 2023 · 2 comments
Open

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

hasary opened this issue Feb 8, 2023 · 2 comments

Comments

@hasary
Copy link

hasary commented Feb 8, 2023

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
Copy link
Author

hasary commented Feb 8, 2023

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
Copy link

Also having this issue with i18next as a peer dependency

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants