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

i18next used in index.d.ts but missing in dependency #45

Closed
m1heng opened this issue Aug 24, 2021 · 2 comments
Closed

i18next used in index.d.ts but missing in dependency #45

m1heng opened this issue Aug 24, 2021 · 2 comments

Comments

@m1heng
Copy link

m1heng commented Aug 24, 2021

🐛 Bug Report

When using pnpm in project, ICU instance's type will be imcompatible with i18next.use

To Reproduce

use pnpm to install dependencies.

import i18next from 'i18next';
import ICU from 'i18next-icu';

const icu = new ICU();

// ts error on blow 'icu'
i18next.use(icu).init();

Type 'IcuInstance<IcuConfig>' provides no match for the signature 'new (...args: any[]): Module'.ts(2345)

as pnpm will not hoist all dependencies to root's node_modules. i18next-icu will not have access to i18next unless dependency was declared in package.json.

Possible solution

add i18next as dependency in package.json

link to pnpm issue pnpm/pnpm#3788

@adrai
Copy link
Member

adrai commented Aug 24, 2021

@pedrodurek can you check this?

@pedrodurek
Copy link
Member

I didn't manage to replicate the issue on a codesandbox, so I'll try locally

@jamuhl jamuhl closed this as completed Feb 6, 2023
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

4 participants