Cannot set property 'locale' of undefined
See original GitHub issueVersion
Reproduction link
Steps to reproduce
when development mode it’s ok, but when built and deployed it shown error.
What is expected ?
works properly
What is actually happening?
c6b25ed7d1e571a9b85f.js:1 [nuxt] Error while initializing app TypeError: Cannot set property 'locale' of undefined
at f.<anonymous> (c6b25ed7d1e571a9b85f.js:1)
at 33b42310abd05a803713.js:2
at 33b42310abd05a803713.js:2
at Array.forEach (<anonymous>)
at 33b42310abd05a803713.js:2
at f._withCommit (33b42310abd05a803713.js:2)
at f.commit (33b42310abd05a803713.js:2)
at f.commit (33b42310abd05a803713.js:2)
at o.commit (33b42310abd05a803713.js:2)
at f.setLocale (c6b25ed7d1e571a9b85f.js:1)
source code: https://github.com/nuxt-community/nuxt-i18n/blob/master/src/plugins/main.js#L41
state got undefined
Additional comments?
Config:
modules: [
['nuxt-i18n', {
locales: [
{ name: '简体中文', code: 'zh', iso: 'zh-CN', file: 'zh.js' },
{ name: 'English', code: 'en', iso: 'en-US', file: 'en.js' }
],
lazy: true,
langDir: 'locales/',
strategy: 'prefix',
defaultLocale: 'zh',
detectBrowserLanguage: {
useCookie: true,
cookieKey: 'i18n_redirected'
},
rootRedirect: 'en',
vueI18n: {
fallbackLocale: 'en'
}
}]
],
deployed files: https://dev.tencent.com/u/willin/p/willin.wang/git/tree/master
- ROOT
- 404.html
- zh/ folder
- en/ folder
Issue Analytics
- State:
- Created 5 years ago
- Reactions:1
- Comments:5
Top Results From Across the Web
Cannot set property 'locale' of undefined · Issue #238 - GitHub
I get following error: Cannot set property 'locale' of undefined TypeError: Cannot set property 'locale' of undefined at Object.
Read more >Cannot set property 'locale' of undefined, not working in replit ...
Repl.it is just not reading the sub-prototype 'locale' from your targetObject you should just try switching hosts :).
Read more >TypeError: Cannot read property 'locale' of undefined - Forums
Hi! I have a very simple Lambda function (with default and basic configuration) that is throwing the following error.
Read more >Cannot set property 'locale' of undefined got when input Enter ...
TypeError : Cannot set property 'locale' of undefined got when input Enter directly in console.
Read more >Locale issue. Cannot read property 'replace' of undefined
We have been getting the above error and I am guessing it it because of the locale. What is the best way to...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@sustained Can you also check with v6.0.2 just to establish whether it’s a recent regression or not?
Also, where is
load state
button in Vue Devtools? I couldn’t find that one but if I clickForce refresh
then whole Vue devtools kinda crash (stop reacting).@rchl