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

Typings TS7016: Could not find a declaration file for module #1670

Closed
5 tasks done
Farnsi opened this issue May 10, 2023 · 9 comments
Closed
5 tasks done

Typings TS7016: Could not find a declaration file for module #1670

Farnsi opened this issue May 10, 2023 · 9 comments
Labels
Status: Review Needed Request for review comments

Comments

@Farnsi
Copy link

Farnsi commented May 10, 2023

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

@Farnsi Farnsi added the Status: Review Needed Request for review comments label May 10, 2023
@luisdeka
Copy link

Same error today

@Farnsi
Copy link
Author

Farnsi commented May 13, 2023

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.

@EagleClark
Copy link

Same error
vue-i18n: 9.2.2
vue: 3.2.47
typescript: 5.0.4

@luisdeka
Copy link

luisdeka commented May 14, 2023

Fixed in beta version, as soon as they release new versions it will be fixed i suppose, at the time, change to v9.3

@larsrickert
Copy link

Hey, is it possible to release this as a quick fix for version 9.2? :)
The issue prevents us from using TypeScript 5

@koczko
Copy link

koczko commented May 26, 2023

Temporary solution.
Work in my case, remove file: tsconfig.node.json

Copy link
Owner

kazupon commented Jun 2, 2023

This repository is vue-i18n v8, not v9
so close

@kazupon kazupon closed this as not planned Won't fix, can't repro, duplicate, stale Jun 2, 2023
@gabrielcaiana
Copy link

The problem was solved? I have the same problem in version 9.4.1

nuxt 3.7.3
node 18.16.0

@larsrickert
Copy link

The problem was solved? I have the same problem in version 9.4.1

nuxt 3.7.3 node 18.16.0

Its fixed for me with vue-i18n version >= 9.3.0 and TypeScript 5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Review Needed Request for review comments
Projects
None yet
Development

No branches or pull requests

7 participants