vercel/next.js · error · Error
Specified i18n.defaultLocale should be a string. See more…
Error message
Specified i18n.defaultLocale should be a string. See more info here: https://nextjs.org/docs/messages/invalid-i18n-config
What it means
i18n config validation in assignDefaultsAndValidate: i18n.defaultLocale was type-checked and is not a string. The default locale must be a single locale tag like 'en-US' that also appears in i18n.locales; the guard fires on the type mismatch before that membership check runs.
Solutions
- Set i18n.defaultLocale to a string.
Defensive patterns
Strategy: validation
When it happens
Trigger: i18n.defaultLocale is not a string.
Common situations: A non-string defaultLocale in next.config i18n.
AI-assisted analysis of vercel/next.js@34433fd12e (2026-08-19).
Data as JSON: /api/errors/ba5b053663b9d3a6.
Report an issue: GitHub.
Appendix: source
Thrown at packages/next/src/server/config.ts:1292
)
}
if (!Array.isArray(i18n.locales)) {
throw new Error(
`Specified i18n.locales should be an Array received ${typeof i18n.locales}.\nSee more info here: https://nextjs.org/docs/messages/invalid-i18n-config`
)
}
if (i18n.locales.length > 100 && !silent) {
Log.warn(
`Received ${i18n.locales.length} i18n.locales items which exceeds the recommended max of 100.\nSee more info here: https://nextjs.org/docs/advanced-features/i18n-routing#how-does-this-work-with-static-generation`
)
}
const defaultLocaleType = typeof i18n.defaultLocale
if (!i18n.defaultLocale || defaultLocaleType !== 'string') {
throw new Error(
`Specified i18n.defaultLocale should be a string.\nSee more info here: https://nextjs.org/docs/messages/invalid-i18n-config`
)
}
if (typeof i18n.domains !== 'undefined' && !Array.isArray(i18n.domains)) {
throw new Error(
`Specified i18n.domains must be an array of domain objects e.g. [ { domain: 'example.fr', defaultLocale: 'fr', locales: ['fr'] } ] received ${typeof i18n.domains}.\nSee more info here: https://nextjs.org/docs/messages/invalid-i18n-config`
)
}
if (i18n.domains) {
const invalidDomainItems = i18n.domains.filter((item) => {
if (!item || typeof item !== 'object') return true
if (!item.defaultLocale) return true
if (!item.domain || typeof item.domain !== 'string') return true
if (item.domain.includes(':')) {
console.warn(View on GitHub (pinned to 34433fd12e)