You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When starting Nuxt i receive the error : ERROR Cannot start nuxt: Cannot create property 'locales' on string '[object Object]'
I am sure this is related to @nuxtjs/i18n, because if i comment it out in the nuxt.config.js modules, the error disappears and my nuxt application runs.
I tried reducing the sample code above to the absolute minimum but the same error remains.
Additional context
No response
Logs
This is the full stack trace:
ERROR Cannot start nuxt: Cannot create property 'locales' on string '[object Object]' nuxi 08:11:57
at prepareRuntime (/C:/Users/dennis/Documents/gad/Projects/gad/frontend/node_modules/@nuxtjs/i18n/dist/module.mjs:1995:50)
at setup (/C:/Users/dennis/Documents/gad/Projects/gad/frontend/node_modules/@nuxtjs/i18n/dist/module.mjs:2234:5)
at async normalizedModule (/C:/Users/dennis/Documents/gad/Projects/gad/frontend/node_modules/@nuxt/kit/dist/index.mjs:2149:17)
at async installModule (/C:/Users/dennis/Documents/gad/Projects/gad/frontend/node_modules/@nuxt/kit/dist/index.mjs:2427:95)
at async initNuxt (/C:/Users/dennis/Documents/gad/Projects/gad/frontend/node_modules/nuxt/dist/shared/nuxt.CrJjphBv.mjs:5339:5)
at async NuxtDevServer._load (/C:/Users/dennis/Documents/gad/Projects/gad/frontend/node_modules/@nuxt/cli/dist/chunks/dev2.mjs:162:5)
at async NuxtDevServer.load (/C:/Users/dennis/Documents/gad/Projects/gad/frontend/node_modules/@nuxt/cli/dist/chunks/dev2.mjs:94:7)
at async NuxtDevServer.init (/C:/Users/dennis/Documents/gad/Projects/gad/frontend/node_modules/@nuxt/cli/dist/chunks/dev2.mjs:89:5)
at async Object.run (/C:/Users/dennis/Documents/gad/Projects/gad/frontend/node_modules/@nuxt/cli/dist/chunks/dev-child.mjs:83:5)
at async runCommand (/C:/Users/dennis/Documents/gad/Projects/gad/frontend/node_modules/citty/dist/index.mjs:316:16)
The text was updated successfully, but these errors were encountered:
I could not create a stackblitz that reproduced this error.
This might be related to using yarn as package manager, there have been a few strange issues exclusive to it recently. A repo with the minimal reproduction would be very helpful to debug this 🙏
The i18n.config.js file is in the same root folder as nuxt.config.js:
This file should be to be in the i18n directory too
Thanks for your fast reply.
Setting the i18n.config.js file in the i18n folder still gives me the same error, but I missed've missed that from the docs that it belongs there, thanks for the headsup!
I'm unable to reproduce the issue with that project, I did have to install typescript as a dependency can you give that try?
The module needs to have some additional checks whether typescript is being used or not, currently it relies on typescript whether it is being used or not, to support loading ts files.
Environment
Reproduction
I could not create a stackblitz that reproduced this error.
The i18n.config.js file is in the same root folder as nuxt.config.js:
The language files are in i18n/locales/nl-be.js, i18n/locales/fr-be.js, i18n/locales/en-be.js. And contain this:
Describe the bug
When starting Nuxt i receive the error :
ERROR Cannot start nuxt: Cannot create property 'locales' on string '[object Object]'
I am sure this is related to @nuxtjs/i18n, because if i comment it out in the nuxt.config.js modules, the error disappears and my nuxt application runs.
I tried reducing the sample code above to the absolute minimum but the same error remains.
Additional context
No response
Logs
The text was updated successfully, but these errors were encountered: