-
-
Notifications
You must be signed in to change notification settings - Fork 762
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. Weβll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some i18n configuration options throw warnings in NextJs 12.2.3 #1920
Comments
Based on the types here it should extend the options correctly... How does your config look like? I suspect you're defining the options in the i18n property, but you should define them outside: https://github.com/i18next/next-i18next/blob/master/examples/simple/next-i18next.config.js I'm not a TypeScript user (maybe @pedrodurek can help?)... |
Reproducable with const { i18n } = require("./next-i18next.config");
module.exports = {
i18n
}; next-i18next.config.js: module.exports = {
i18n: {
defaultLocale: "en-GB",
locales: ["en-GB"],
keySeparator: "."
}
}; |
Try:
|
Yep, I am defining them inside. Outside doesn't warn, thanks! |
Still have the warning in Nextjs v12.2.4 warn - Invalid next.config.js options detected:
The root value has an unexpected property, returnEmptyString (and fallbackLng) which is not in the list of allowed properties module.exports = {
i18n: {
defaultLocale: "en-GB",
locales: ["en-GB"]
},
fallbackLng: 'en',
returnEmptyString: false,
}; If I put them inside
Where should I put those i18next configs? |
@MonstraG Can you confirm? |
No, for me everything is ok.
const path = require("path");
const languages = require("./i18n.languages.js");
/** @type import("next").I18NConfig */
const i18n = {
defaultLocale: process.env.DEFAULT_LANGUAGE,
locales: languages,
localeDetection: false // disable automatic redirection on the user's preferred locale
};
/** @type import("next-i18next").UserConfig */
const next18nextConfig = {
i18n,
fallbackLng: process.env.NEXT_PUBLIC_FALLBACK_LANGUAGE,
keySeparator: ".",
nsSeparator: ":",
localePath: path.resolve("./public/static/locales"),
reloadOnPrerender: process.env.NODE_ENV === "development"
};
module.exports = next18nextConfig;
const { i18n } = require("./next-i18next.config");
/** @type import("next").NextConfig */
const config = {
swcMinify: true,
optimizeFonts: false,
compiler: {
emotion: true
},
i18n
};
module.exports = config; |
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 Thank you for the reminder β€οΈ |
Modify i18n configuration : i18next/next-i18next#1920 / https://github.com/i18next/next-i18next#passing-other-config-options Rename middleware file : https://nextjs.org/docs/messages/middleware-upgrade-guide#how-to-upgrade
Modify i18n configuration : i18next/next-i18next#1920 / https://github.com/i18next/next-i18next#passing-other-config-options Rename middleware file : https://nextjs.org/docs/messages/middleware-upgrade-guide#how-to-upgrade
Modify i18n configuration : i18next/next-i18next#1920 / https://github.com/i18next/next-i18next#passing-other-config-options Rename middleware file : https://nextjs.org/docs/messages/middleware-upgrade-guide#how-to-upgrade
feat: β¬οΈ Upgrade to Next 12.2 Modify i18n configuration : i18next/next-i18next#1920 / https://github.com/i18next/next-i18next#passing-other-config-options Rename middleware file : https://nextjs.org/docs/messages/middleware-upgrade-guide#how-to-upgrade fix: π Fix typing bug => src take only string input chore: β¬οΈ Upgrade i18next version 22 wip refactor: β¬οΈ Run next-image-to-legacy-image codemod fix: π Fix middleware.ts folder fix: β»οΈ Fix TS linter error with react-i18next mainly chore: β¬οΈ Upgrade some dependencies chore: β¬οΈ Upgrades dependencies fix: β»οΈ TS types fixes chore: β¬οΈ Upgrades dependencies fix: β π
feat: β¬οΈ Upgrade to Next 12.2 Modify i18n configuration : i18next/next-i18next#1920 / https://github.com/i18next/next-i18next#passing-other-config-options Rename middleware file : https://nextjs.org/docs/messages/middleware-upgrade-guide#how-to-upgrade fix: π Fix typing bug => src take only string input chore: β¬οΈ Upgrade i18next version 22 wip refactor: β¬οΈ Run next-image-to-legacy-image codemod fix: π Fix middleware.ts folder fix: β»οΈ Fix TS linter error with react-i18next mainly chore: β¬οΈ Upgrade some dependencies chore: β¬οΈ Upgrades dependencies fix: β»οΈ TS types fixes chore: β¬οΈ Upgrades dependencies fix: β π
feat: β¬οΈ Upgrade to Next 12.2 Modify i18n configuration : i18next/next-i18next#1920 / https://github.com/i18next/next-i18next#passing-other-config-options Rename middleware file : https://nextjs.org/docs/messages/middleware-upgrade-guide#how-to-upgrade fix: π Fix typing bug => src take only string input chore: β¬οΈ Upgrade i18next version 22 wip refactor: β¬οΈ Run next-image-to-legacy-image codemod fix: π Fix middleware.ts folder fix: β»οΈ Fix TS linter error with react-i18next mainly chore: β¬οΈ Upgrade some dependencies chore: β¬οΈ Upgrades dependencies fix: β»οΈ TS types fixes chore: β¬οΈ Upgrades dependencies fix: β π
Integration of https://github.com/dataesr/react-dsfr for header and footer β¬οΈ Update NextJS 12 => 13 (React 18) β Install dsfr for React Numerous dependencies upgrades π Change global font for Marianne π Prevent NPE when themes are not loaded β¨ Creation of the header in DSFR format β¨ Creation of the footer in DSFR format β¨ Creation of the backend header in DSFR format π Add translations π§ͺ Update tests Impacts : Image import => using legacy mode Linter : most of modified files are linted by prettier reacti18n : rewrites to Typescript => typings adapations links : use legacyBehavior on every pre-existing <Link> (to be processed later) SubscribeNewsletterModal rewrites to use redux for is state (show / hide) ---- * feat: β¬οΈ Upgrade Next feat: β¬οΈ Upgrade to Next 12.2 Modify i18n configuration : i18next/next-i18next#1920 / https://github.com/i18next/next-i18next#passing-other-config-options Rename middleware file : https://nextjs.org/docs/messages/middleware-upgrade-guide#how-to-upgrade fix: π Fix typing bug => src take only string input chore: β¬οΈ Upgrade i18next version 22 wip refactor: β¬οΈ Run next-image-to-legacy-image codemod fix: π Fix middleware.ts folder fix: β»οΈ Fix TS linter error with react-i18next mainly chore: β¬οΈ Upgrade some dependencies chore: β¬οΈ Upgrades dependencies fix: β»οΈ TS types fixes chore: β¬οΈ Upgrades dependencies fix: β π * chore: β Install dsfr for React * feat: π Change global font for Marianne * fix: π Prevent NPE when themes are not loaded * feat: β¨ Creation of the header in DSFR format * feat: β¨ Creation of the Footer & Backend Header in DSFR format Many other adjustment after technical upgrades and UI updates * fix: πΈ The translation menu is visible even if the screen is small * fix: π Fix footer copyright label size
π Bug Report
Warning example:
For me this happens with
fallbackLng, keySeparator, nsSeparator, localePath, reloadOnPrerender
, but I'm assuming it would happen with each property that is not mentioned inI18NConfig
, which isTo 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
Folks from nextjs said that the issue is on this end
The text was updated successfully, but these errors were encountered: