Some i18n configuration options throw warnings in NextJs 12.2.3
See original GitHub issue🐛 Bug Report
Warning example:
warn - Invalid next.config.js options detected:
[
{
"instancePath": "/i18n",
"schemaPath": "#/properties/i18n/additionalProperties",
"keyword": "additionalProperties",
"params": {
"additionalProperty": "fallbackLng"
},
"message": "must NOT have additional properties"
},
...
]
For me this happens with fallbackLng, keySeparator, nsSeparator, localePath, reloadOnPrerender
, but I’m assuming it would happen with each property that is not mentioned in I18NConfig
, which is
export interface I18NConfig {
defaultLocale: string;
domains?: DomainLocale[];
localeDetection?: false;
locales: string[];
}
To Reproduce
Update to nextjs 12.2.3, add one of the mentioned properties to i18n section and run build.
Expected behavior
No warnings.
Your Environment
"next": "^12.2.3",
"next-i18next": "^11.3.0",
...
"i18next@npm:^21.8.13":
version: 21.8.14
windows
Folks from nextjs said that the issue is on this end
Issue Analytics
- State:
- Created a year ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Getting next config warning adding nex-i18n additional property
when using a path resolution to the locale paths NextJS complains about a property warn - Invalid next.config.js options detected: ...
Read more >Advanced Features: Error Handling - Next.js
This component will be responsible to: Render a fallback UI after an error is thrown; Provide a way to reset the Application's state;...
Read more >next-i18next - npm
The easiest way to translate your NextJs apps. ... passing translations and configuration options into pages as props with SSG/SSR support.
Read more >Next.js 12.2 Overview: Middleware, Layouts, and more
Next.js 12.2 introduces stable Middleware and On-Demand ISR, experimental Edge SSR and API Routes, and more.0:00 Intro1:50 Agenda2:30 ...
Read more >Manual Setup for Next.js - Sentry Documentation
As a result, some of the auto-instrumentation done by @sentry/nextjs doesn't ... build-time configuration options sentry: { // See the sections below for ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Sorry, it was my mistake that I passed all i18next configs to Next . I missed the instruction https://github.com/i18next/next-i18next#passing-other-config-options that only need to import
i18n
object for Next config.Thank you for the reminder ❤️
No, for me everything is ok.
next-i18next.config.js
:next.config.js
: