-
-
Notifications
You must be signed in to change notification settings - Fork 10
useI18n(); in setup function throws error #14
Comments
Struggling with the same problem. Would like to add more value to this but can't since I'm also using the same versions. |
solved problem for me import { useI18n } from 'vue-i18n-composable/src/index'
import { createI18n } from 'vue-i18n-composable/src/index' |
Has anyone solved this problem?Struggling with the same problem when i run example in this project. maybe fix by #15 |
the trick from @cyio works for me |
In my case, I was using script setup and import { useI18n } from 'vue-i18n-composable' was working okay, but started throwing the error in testing, and I changed the path as @cyio suggested and ta-da! Now it's working perfectly, thank you! |
I also meet this error in vitest |
@kingyue737 Did you try #14 (comment)? I am using vitest as well, but changing path in all vue files fixed error |
Thanks @nagisaando , it should work. But I don't want to directly import source code from package. I would have liked to migrate to vue-i18n-bridge which seems to have a valid Finally, I modify the |
I solved this problem by installing the latest version of i18n. |
calling useI18n() in composition API setup creates an error, since I updated my versions.
creates this:
Versions:
vue-i18n: 8.26.5
vue-i18n-composable@npm:0.2.2
main.ts (minimal version)
Is this still the correct way to use i18n programatically?
Edit: updated usage if of useI18n(); and added main.ts
The text was updated successfully, but these errors were encountered: