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
Type '(string | undefined)[]' is not assignable to type 'string[]'.
Type 'string | undefined' is not assignable to type 'string'.
Type 'undefined' is not assignable to type 'string'.ts(2322)
module.d.ts(283, 5): The expected type comes from property 'domains' which is declared here on type 'LocaleObject<string>'
If we try set it to "any":
const i18nDomains = [
"mydomain.com",
"mydomain.se",
localeDomains.en,
localeDomains.se,
] as any; // or as string[]
Let's try with:
defaultForDomains: ["mydomain.com", localeDomains.en],
// Error:
Type 'string | undefined' is not assignable to type 'string'.
Type 'undefined' is not assignable to type 'string'.ts(2322)
(alias) const localeDomains: {
en: string | undefined;
se: string;
}
import localeDomains
Need to use:
en: process.env.DOMAIN_EN as string,
But this wont make a difference it seems.
Then try to run it:
$env:DOMAIN_SE="mydomain.se"; npm run dev
// This isn't correct either
$env:DOMAIN_SE="se"; npm run dev
// Nor is this
$env:DOMAIN_SE; npm run dev
mydomain.com should load locale EN
mydomain.se should load locale SE
+
work in dev with ENV variables and support "npm run generate" with correct locale.
No translation is happening.
What is the correct way to define the ENV variable?
Describe the bug
Type errors trying to assign an array to domains key.
And no translation is happening trying to use ENV variables.
Additional context
No response
Logs
The text was updated successfully, but these errors were encountered:
Environment
Reproduction
Following guide: https://i18n.nuxtjs.org/docs/guide/multi-domain-locales
Will error in IDE for the "domains" key:
If we try set it to "any":
Let's try with:
Need to use:
But this wont make a difference it seems.
Then try to run it:
No translation is happening.
What is the correct way to define the ENV variable?
Describe the bug
Type errors trying to assign an array to domains key.
And no translation is happening trying to use ENV variables.
Additional context
No response
Logs
The text was updated successfully, but these errors were encountered: