Skip to content

v16.3.0

Latest

Choose a tag to compare

@adrai adrai released this 07 Sep 15:22
  • App Router: createServerI18next(config) — returns { getT, getResources, generateI18nStaticParams } bound to the config, so the server API no longer depends on initServerI18next having run first in the same module instance. Create it once in an i18n.server.ts and import from there: every caller then imports the module that holds the config, and neither module evaluation order nor a second bundling layer (Route Handlers live in their own) can reach getT uninitialized. initServerI18next and the module-level functions keep working. #2347
  • App Router: default server state is keyed on globalThis — a second copy of next-i18next/server in the same process (another bundling layer, or the CJS build next to the ESM one) now sees the same initServerI18next call instead of throwing. The "not initialized" error also names the real requirement (before the first getT() in the process) and points at createServerI18next. #2347