Typings TS7016: Could not find a declaration file for module
Farnsi opened this issue · comments
Reporting a bug?
import { createI18n } from 'vue-i18n'
^^^^^^^^
TS-Error
Could not find a declaration file for module 'vue-i18n'.
'/my-project/node_modules/vue-i18n/dist/vue-i18n.esm-bundler.js' implicitly has an 'any' type.
There are types at '/my-project/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.ts(7016)
Expected behavior
Use .d.ts-file.
Reproduction
https://jsfiddle.net/kazupon/rn724baz/3/
System Info
vue-i18n: 9.2.2
vue: 3.2.47
typescript: 5.0.4
Screenshot
No response
Additional context
No response
Validations
- Read the Contributing Guidelines
- Read the Documentation
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion
- The provided reproduction is a minimal reproducible example of the bug.
Same error today
As soon as i remove the complete "exports": {
block from package.json, it works.
No error and move over import { createI18n } from 'vue-i18n'
or $t('...
in VSCode shows the correct type definitions.
Same error
vue-i18n: 9.2.2
vue: 3.2.47
typescript: 5.0.4
Fixed in beta version, as soon as they release new versions it will be fixed i suppose, at the time, change to v9.3
Hey, is it possible to release this as a quick fix for version 9.2? :)
The issue prevents us from using TypeScript 5
Temporary solution.
Work in my case, remove file: tsconfig.node.json
This repository is vue-i18n v8, not v9
so close