Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

273
Views
Cannot read properties of undefined (reading 'use') when using Vue.use(VueI18n)

I'm trying to make i18n in my Vue project, then an error just occur.

Uncaught TypeError: Cannot read properties of undefined (reading 'use')

here is my project tree:

| -- Project
     | -- src
          | -- App.vue
          | -- main.js
          | -- store
               |-- index.js
          | -- lang
               | -- i18n.js
               | -- tw.json
               | -- en.json

i18n.js:

import Vue from 'vue';
import VueI18n from 'vue-i18n';

Vue.use(VueI18n);

import tw from './tw.json';
import en from './en.json';

const i18n = new VueI18n({
    locale: localStorage.getItem('lang') || 'tw',
    messages: { tw, en }
});

export default i18n;

main.js:

...
import i18n from "./lang/i18n";
app.use(i18n);

"vue": "^3.0.0", "vue-i18n": "^8.26.8", Node: v14.18.0

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

add main js:

new Vue({
  render: h => h(App),
  i18n
}).$mount('#app');

and

import i18n from "./lang/i18n";

change to

and * as i18n from "./lang/i18n";
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!