vue-i18n createApp showing Uncaught TypeError: Cannot read property 'config' of undefined

Viewed 751

I wanna use localization using vue-i18n, the version that i use is "vue-i18n": "^8.22.1", after importing like this on main.js

import { createApp } from "vue";
import App from "./App.vue";
import router from "./router";
import VueI18n from 'vue-i18n';

const messages = {
  en: {
    message: {
      hello: 'hello world'
    }
  },
  ja: {
    message: {
      hello: 'こんにちは、世界'
    }
  }
}

// Create VueI18n instance with options
const i18n = new VueI18n({
  locale: 'ja', // set locale
  messages, // set locale messages
})

createApp(App)
  .use(router)
  .use(i18n)
  .mount("#app");

The message "Uncaught TypeError: Cannot read property 'config' of undefined" show up. there are similar problem with this ( Vue-i18n - Cannot read property 'config' of undefined ) , but it use new Vue, How to use vue-i18n using createApp ?

0 Answers
Related