I have a Next.js site (with plans to host it on Vercel, not that it's relevant..) and I'd like to set up different default locales on different domains. Here is my (redacted) next.config.js:
module.exports = {
i18n: {
locales: ['en', 'cs'],
defaultLocale: 'en',
localeDetection: true,
domains: [{
domain: 'humanely.it',
defaultLocale: 'en',
}, {
domain: 'lidsky.it',
defaultLocale: 'cs',
}, {
domain: 'itlidsky.cz',
defaultLocale: 'cs',
}],
},
}
...and here's the error:
Both lidsky.it and itlidsky.cz configured the defaultLocale cs but only one can. Change one item's default locale to continue
Both itlidsky.cz and lidsky.it configured the defaultLocale cs but only one can. Change one item's default locale to continue
Error: Invalid i18n.domains values:
{"domain":"lidsky.it","defaultLocale":"cs"}
{"domain":"itlidsky.cz","defaultLocale":"cs"}
I understand what the error is saying perfectly well - the thing is... seriously??? Did I miss something or does it actually, seriously mean that no 2 domains can have the same default locale configured? I mean, I see zero reasons why 2 different domains can't have the same default locale.
Can I somehow configure the same default locale for 2 domains, or is this a deliberate defect on part of Next.js?