rsnext/errors/invalid-i18n-config.md
JJ Kasper 8b4d6246f3
Add err.sh for i18n config errors (#18425)
This adds an err.sh with info that can help when tracking down errors from invalid i18n config in next.config.js
2020-10-29 03:48:24 +00:00

1.1 KiB

Invalid i18n config

Why This Error

In your next.config.js file you provided an invalid config for the i18n field.

Possible Ways to Fix It

Make sure your i18n field follows the allowed config shape and values:

module.exports = {
  i18n: {
    // These are all the locales you want to support in
    // your application
    locales: ['en-US', 'es', 'fr', 'nl-NL'],
    // This is the default locale you want to be used when visiting
    // a non-locale prefixed path e.g. `/hello`
    defaultLocale: 'en-US',
    // This is a list of locale domains and the default locale they
    // should handle (these are only required when setting up domain routing)
    domains: [
      {
        domain: 'example.com',
        defaultLocale: 'en-US',
        // other locales that should be handled on this domain
        locales: ['es'],
      },
      {
        domain: 'example.nl',
        defaultLocale: 'nl-NL',
      },
      {
        domain: 'example.fr',
        defaultLocale: 'fr',
      },
    ],
  },
}