question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Uncaught TypeError: Cannot read property 'config' of undefined

See original GitHub issue

Hi,

I have just copy the basic example in the Getting Started section. But I get this error message each time from this file : vue-i18n.esm.js

vue & vue-i18n version

2.1.10, 6.1.1

Basic code

import VueI18n from 'vue-i18n';
import Locales from './vue-i18n-locales.generated.js';


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
});

Get this error message from this function

And each time I got the same error message for this code part

VueI18n.prototype._initVM = function _initVM (data) {
  var silent = Vue.config.silent;
  Vue.config.silent = true;
  this._vm = new Vue({ data: data });
  Vue.config.silent = silent;
};

Any idea ? Thanks for your help.

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:23
  • Comments:16 (2 by maintainers)

github_iconTop GitHub Comments

184reactions
dbalascommented, May 11, 2017

Hi @gmarineau you have to do “.use” before create i18n instance:

import Vue from 'vue';
import VueI18n from 'vue-i18n';
import Locales from './vue-i18n-locales.generated.js';

// here
Vue.use(VueI18n)

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
});
12reactions
kazuponcommented, Jun 12, 2017

Close (in-activity)

Read more comments on GitHub >

github_iconTop Results From Across the Web

TypeError: Cannot read property 'config' of undefined ... - GitHub
The error occurs when a null/undefined value is passed to the tailwindcss function. 2
Read more >
Cannot read property 'config' of null TypeError - Stack Overflow
This error occurs when angular cannot find .angular-cli.json file (Do note there is a dot in the file name). Usually it is a...
Read more >
Cannot read property 'config' of undefined
I get this error just randomly: Uncaught Error in $A.getCallback() [Cannot read property ' ...
Read more >
TypeError: Cannot read property 'config' of null at Class.run
Try the following steps remove the `node_modules` folder. Delete the yarn.lock is you have one. then `npm Install` or the yarn variant. Regards....
Read more >
typeerror: cannot read properties of undefined (reading 'config')
You're passing an empty object to User.findAll({}) in your UserController.js file. Try User.findAll() , instead.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found