2

when using a path resolution to the locale paths NextJS complains about a property

warn  - Invalid next.config.js options detected: 
[
  {
    "instancePath": "/i18n",
    "schemaPath": "#/properties/i18n/additionalProperties",
    "keyword": "additionalProperties",
    "params": {
      "additionalProperty": "localePath"
    },
    "message": "must NOT have additional properties"
  }
] 

Config file:

const path = require('path')

module.exports = {
  i18n: {
    defaultLocale: 'en',
    // locales: ['en', 'es', 'ko', 'ru', 'tr', 'vi'],
    locales: ['en', 'tr'],
    localePath: path.resolve('./public/locales')
  }
}

Latest NextJS and next-i18n Anyone experiencing the same?

Best,

Caio Lucas
  • 139
  • 1
  • 4
  • 4
    The `localePath` property should be outside the `i18n` object in your `next-i18next.config.js` file. See https://github.com/i18next/next-i18next#6-advanced-configuration. – juliomalves Aug 02 '22 at 20:51

0 Answers0