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

vue-i18n does not work with Typescript 5 #1415

Closed
4 tasks done
DerZade opened this issue May 31, 2023 · 4 comments
Closed
4 tasks done

vue-i18n does not work with Typescript 5 #1415

DerZade opened this issue May 31, 2023 · 4 comments

Comments

@DerZade
Copy link

DerZade commented May 31, 2023

Reporting a bug?

Version 9.2.2 does not work with typescript 5.0.4

error TS7016: Could not find a declaration file for module 'vue-i18n'. '<PROJECT_DIR>/node_modules/vue-i18n/dist/vue-i18n.esm-bundler.js' implicitly has an 'any' type.
  There are types at '<PROJECT_DIR>/node_modules/vue-i18n/dist/vue-i18n.d.ts', but this result could not be resolved when respecting package.json "exports". The 'vue-i18n' library may need to update its package.json or typings.

31 import { useI18n } from 'vue-i18n';
                           ~~~~~~~~~~

Expected behavior

I expect it not to error 😅

Reproduction

The following is simply a project created with npm create vue@latest with all options set to "No", except Typescript.

https://github.com/DerZade/vue-i18n-bug-report

System Info

├── typescript@5.0.4
├── vite@4.3.9
├── vue-i18n@9.2.2
└── vue@3.3.4

Screenshot

No response

Additional context

No response

Validations

@DerZade DerZade added the Status: Review Needed Request for review comments label May 31, 2023
@DerZade
Copy link
Author

DerZade commented May 31, 2023

There is already a issue in the old repository (kazupon/vue-i18n#1670), but I took the liberty of opening a new one in the correct repo.

@DerZade DerZade changed the title TS7016: Could not find a declaration file for module 'vue-i18n'. vue-i18n does not work with Typescript 5 May 31, 2023
Copy link
Member

kazupon commented Jun 2, 2023

As I commented on this issue vue-i18n v9.3 will fix that issue.
#1327 (comment)

If you will avoid this issue, I would recommend installing the next tag version, (i.e. vue-i18n v9.3).
Currently in beta, this version has not changed much in terms of functionality from v9.2. Actually, It's used in nuxt i18n v8 beta.

close this issue, so duplicate.
Thanks!

@kazupon kazupon removed the Status: Review Needed Request for review comments label Jun 2, 2023 — with Volta.net
@kazupon kazupon closed this as not planned Won't fix, can't repro, duplicate, stale Jun 2, 2023
@Bauxitedev
Copy link

For future reference, if anyone runs into this issue even when upgrading to the 9.3 beta, you need to upgrade to version 9.3.0-beta.19, not 9.3.0-beta.11.

@xieyezi
Copy link

xieyezi commented Aug 30, 2023

thanks

For future reference, if anyone runs into this issue even when upgrading to the 9.3 beta, you need to upgrade to version 9.3.0-beta.19, not 9.3.0-beta.11.

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