vercel/next.js · error · Error

Specified i18n should be an object received

Error message

Specified i18n should be an object received ${i18nType}.
See more info here: https://nextjs.org/docs/messages/invalid-i18n-config

What it means

i18n config validation in assignDefaultsAndValidate: result.i18n is present but typeof i18n is not 'object'. The i18n block must be an options object with locales/defaultLocale; the received type is named and the error links the invalid-i18n-config docs.

Solutions

  1. Set i18n to an object with locales and defaultLocale.
Defensive patterns

Strategy: validation

When it happens

Trigger: i18n config is not an object.

Common situations: Passing an array or primitive as i18n in next.config.


AI-assisted analysis of vercel/next.js@34433fd12e (2026-08-19). Data as JSON: /api/errors/da752c237df90828. Report an issue: GitHub.

Appendix: source

Thrown at packages/next/src/server/config.ts:1272

    }
  }
  if (!rootDir) {
    throw new Error(
      'Failed to find the root directory of the project. This is a bug in Next.js.'
    )
  }
  // Ensure both properties are set to the same value
  result.outputFileTracingRoot = rootDir
  dset(result, ['turbopack', 'root'], rootDir)

  setHttpClientAndAgentOptions(result || defaultConfig)

  if (result.i18n) {
    const { i18n } = result
    const i18nType = typeof i18n

    if (i18nType !== 'object') {
      throw new Error(
        `Specified i18n should be an object received ${i18nType}.\nSee more info here: https://nextjs.org/docs/messages/invalid-i18n-config`
      )
    }

    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

View on GitHub (pinned to 34433fd12e)