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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

i18next@23.7 sneakily breaks building with older typescript versions #2090

Closed
kcaswick opened this issue Dec 14, 2023 · 4 comments
Closed

i18next@23.7 sneakily breaks building with older typescript versions #2090

kcaswick opened this issue Dec 14, 2023 · 4 comments
Assignees

Comments

@kcaswick
Copy link

馃挜 Regression Report

Dependencies on i18next@^23.4 now install 23.7.10, causing tsc to fail with error:

node_modules/i18next/typescript/t.v4.d.ts:103:69 - error TS1005: '?' expected.

This was discovered when first installing a package which depends on i18next, and at first was thought to be a dependency conflict of the direct dependency, since it worked fine in another project.

Last working version

Worked up to version: 23.6.0

Stopped working in version: 23.7.0

To Reproduce

Steps to reproduce the behavior:

  • In a clone of i18next: (tested with checkouts of both v23.6.0 and master)
  • cd .\examples\typescript\
  • npm i typescript@4.5.5
  • npm run build
> npm run build

> typescript-example@1.0.0 build
> tsc

node_modules/i18next/typescript/t.v4.d.ts:103:69 - error TS1005: '?' expected.

103   : _FallbackNamespace extends (infer UnionFallbackNs extends string)[]
                                                                        ~


Found 1 error.

Expected behavior

npm to select a compatible version of i18next or report a dependency conflict with typescript

npm run build to succeed

> npm run build

> typescript-example@1.0.0 build
> tsc

Your Environment

  • runtime version: Node v16.20.1
  • i18next version: 23.7.10
  • os: Windows
@adrai
Copy link
Member

adrai commented Dec 14, 2023

Feel free to provide a PR if you know how to address this...

@kcaswick
Copy link
Author

I do not offhand. Most likely a tweak to the special t.v4.d.ts that was added for backwards compatibility is a good idea.

I think last time I tried, npm did not have a good way to express "this dependency is optional, but if you use it, use at least 4.7".

We're using the workaround of overriding to i18next 23.6.0.

adrai added a commit that referenced this issue Dec 14, 2023
@adrai
Copy link
Member

adrai commented Dec 14, 2023

I just tried something with v23.7.11

@kcaswick
Copy link
Author

That fixed it! Thank you very much!

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

No branches or pull requests

3 participants