Version
v5.3.0
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
This bug report is available on Nuxt community (#c183)
Version
v5.3.0
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?
source code: https://github.com/nuxt-community/nuxt-i18n/blob/master/src/plugins/main.js#L41
state got
undefinedAdditional comments?
Config:
deployed files: https://dev.tencent.com/u/willin/p/willin.wang/git/tree/master