Hello everyone! This is my first experience using vue-i18n
in a project with TypeScript + Vue
. Following the instructions from the official site, I installed it using yarn install vue-i18n
. Next, I tried to import it into main.ts
using import VueI18n from 'vue-i18n'
, but encountered the following error. Can anyone help me understand why this is happening and how I can resolve it? Thank you in advance.
Module
'"/Users/scott/Desktop/Pando/uikit-main/node_modules/vue-i18n/dist/vue-i18n"'
has no default export.
Did you mean to use 'import { VueI18n } from "/Users/scott/Desktop/Pando/uikit-main/node_modules/vue-i18n/dist/vue-i18n"' instead?ts(2613)
The version of vue-i18n
I am using is
"vue-i18n": "^9.1.9"
. When I try importing vue-i18n
as suggested and continue with Vue.use(VueI18n)
, another error occurs.
'VueI18n' only refers to a type, but is being used as a value here.ts(2693)
I suspect that this is because vue-i18n
only exports some interfaces.
(alias) interface VueI18n<Messages = {}, DateTimeFormats = {}, NumberFormats = {}>
import VueI18n
Upon further investigation, I realized that the keyword VueI18n
in the import statement does not have a default export.