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 override locales from Layer, I get an error: When using the langDir option the locales must be a list of objects. How to override Layer configuration from project layer?
#2978
Open
lna1989 opened this issue
Jun 14, 2024
· 3 comments
I need to remove unnecessary languages that are present in the Layer.
To override, Nuxt tells us to use the arrow function.
But I get an error: When using the langDir option the locales must be a list of objects if switch:
[6:05:55 PM] ERROR Cannot start nuxt: [@nuxtjs/i18n]: In project layer (/home/projects/nuxt-starter-7ixgvf/nuxt.config) - When using the langDir option the locales must be a list of objects.
at checkLayerOptions (node_modules/@nuxtjs/i18n/dist/module.mjs:681:13)
at setup (node_modules/@nuxtjs/i18n/dist/module.mjs:1771:5)
at normalizedModule (node_modules/@nuxtjs/i18n/node_modules/@nuxt/kit/dist/index.mjs:2212:37)
at async Module.installModule (node_modules/@nuxt/kit/dist/index.mjs:2499:95)
at async initNuxt (node_modules/nuxt/dist/index.mjs:4040:7)
at async NuxtDevServer._load (node_modules/nuxi/dist/chunks/dev2.mjs:267:5)
at async NuxtDevServer.load (node_modules/nuxi/dist/chunks/dev2.mjs:199:7)
at async NuxtDevServer.init (node_modules/nuxi/dist/chunks/dev2.mjs:194:5)
at async Object.run (node_modules/nuxi/dist/chunks/dev-child.mjs:115:5)
at async runCommand$1 (node_modules/nuxi/dist/shared/nuxi.a9f3bca7.mjs:1678:16)
The text was updated successfully, but these errors were encountered:
lna1989
changed the title
When override locales from Layer, I get an error: When using the langDir option the locales must be a list of objects. How to override Layer configuration from project layer?tion on pro
When override locales from Layer, I get an error: When using the langDir option the locales must be a list of objects. How to override Layer configuration from project layer?
Jun 14, 2024
Hmm I can only find docs about overwriting with a function for app.config.tshere, I'll look into figuring out a way to allow overwriting locales with a function.
@kazupon@BobbieGoede
Oh, I'm sorry, it looks like I really messed up the rewrite functionality in app.config.ts. But in any case, we must have some method not of extending, but of overwriting the configuration described in nuxt.config.ts for i18n.
Under the hood, the functionality uses https://github.com/unjs/c12
And the same approach is used there through specifying the mergeStrategy function, as far as I understand, just like in app.config.ts - unjs/c12#145
Environment
Reproduction
https://stackblitz.com/edit/nuxt-starter-cchusa?file=nuxt.config.ts
Describe the bug
I need to remove unnecessary languages that are present in the Layer.
To override, Nuxt tells us to use the arrow function.
But I get an error: When using the langDir option the locales must be a list of objects if switch:
to
Additional context
No response
Logs
[6:05:55 PM] ERROR Cannot start nuxt: [@nuxtjs/i18n]: In project layer (/home/projects/nuxt-starter-7ixgvf/nuxt.config) - When using the langDir option the locales must be a list of objects. at checkLayerOptions (node_modules/@nuxtjs/i18n/dist/module.mjs:681:13) at setup (node_modules/@nuxtjs/i18n/dist/module.mjs:1771:5) at normalizedModule (node_modules/@nuxtjs/i18n/node_modules/@nuxt/kit/dist/index.mjs:2212:37) at async Module.installModule (node_modules/@nuxt/kit/dist/index.mjs:2499:95) at async initNuxt (node_modules/nuxt/dist/index.mjs:4040:7) at async NuxtDevServer._load (node_modules/nuxi/dist/chunks/dev2.mjs:267:5) at async NuxtDevServer.load (node_modules/nuxi/dist/chunks/dev2.mjs:199:7) at async NuxtDevServer.init (node_modules/nuxi/dist/chunks/dev2.mjs:194:5) at async Object.run (node_modules/nuxi/dist/chunks/dev-child.mjs:115:5) at async runCommand$1 (node_modules/nuxi/dist/shared/nuxi.a9f3bca7.mjs:1678:16)
The text was updated successfully, but these errors were encountered: