-
-
Notifications
You must be signed in to change notification settings - Fork 37
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
TS files are not loaded (@intlify/unplugin-vue-i18n/messages
)
#266
Comments
@intlify/unplugin-vue-i18n/messages
)
I have an issue which might be related. When updating to the latest dependencies, I get the following error when I execute vitest: Error: Cannot find module ' @intlify/unplugin-vue-i18n/messages'. It did work before updating vitest from 0.31.3 to 0.32.0 |
This issue is the same, i have done the proposal of just import .ts and inject to VueI18nPlugin. This will allow to infer message types maybe without the need of create a vue-i18n.d.ts file declaring module with messageKeys |
@kazupon is loading js / ts files supported trough vite (@intlify/unplugin-vue-i18n/messages)? If not, can you point me in the right direction where this should be implemented, so I can make a PR. |
Also have some similar issue. Any idea how to configure the NOTE: I am using "@intlify/unplugin-vue-i18n": "^0.11.0" |
👋 Currently running into this same issue - anyone have a solution? |
I am using "@intlify/unplugin-vue-i18n": "^0.12.0" and am having the same problem, the documentation by @intlify/unplugin-vue-i18n is really bad |
I did some digging to try to figure out my own issue with this as I ran into it myself. Just writing my findings down in case someone else falls down the rabbithole. From what I can tell currently by using the message compiler (@intlify/unplugin-vue-i18n/messages), it only handles files that has a yaml/json extension. Everything else is skipped. It is possible to use the plugin with files with other extensions if you import the messages yourself:
I guess more of a discussion at this point, but what is message-compiler planned to support? My current problem is that we use identifiers to export localization-data and that doesn't work in the unplugin-versions so upgrading vite seems to be a hassle. The hack appears to be to return a function that returns the identifier (variable), but atleast it doesn't require a rewrite of everything. |
same issue here but it works when I comment/remove all this VueI18nPlugin part:
But of course I don't want to remove that. Using js files cause it's better for spliting |
same issue |
I'm in a similar situation, I just used JSON files instead of TS and it fixed the problem, but it's not an ideal solution. |
Yea its not, cause we cant put comments on JSON files |
Reporting a bug?
main.ts
vite.config.ts
src/locales/en.ts
Expected behavior
It should load the messages from the TS files?
Reproduction
https://github.com/yooouuri/ts-files-unplugin-vue-i18n
Issue Package
unplugin-vue-i18n
System Info
Screenshot
No response
Additional context
No response
Validations
The text was updated successfully, but these errors were encountered: