i18next / i18next-chained-backend

An i18next backend to chain multiple backends (add fallbacks, caches, ...)
MIT License
69 stars 10 forks source link

Nextjs runtime error #31

Closed Naggertooth closed 1 year ago

Naggertooth commented 1 year ago

🐛 Bug Report

Latest nextjs and react versions produces a runtime error in nextjs due to

i18nextChainedBackend.js?6320:46 Uncaught TypeError: Cannot read properties of null (reading 'init')
    at eval (i18nextChainedBackend.js?6320:46:1)
    at Array.forEach (<anonymous>)
    at Backend.init (i18nextChainedBackend.js?6320:44:1)
    at new Connector (i18next.js?a850:1666:1)
    at I18n.init (i18next.js?a850:2076:1)
    at eval (browser.js?7243:14:1)
    at eval (appWithTranslation.js?deac:42:34)
    at mountMemo (react-dom.development.js?ac89:17225:1)
    at Object.useMemo (react-dom.development.js?ac89:17670:1)
    at useMemo (react.development.js?1b7e:1650:1)
    at AppWithTranslation (appWithTranslation.js?deac:25:23)
    at renderWithHooks (react-dom.development.js?ac89:16305:1)
    at mountIndeterminateComponent (react-dom.development.js?ac89:20074:1)
    at beginWork (react-dom.development.js?ac89:21587:1)
    at HTMLUnknownElement.callCallback (react-dom.development.js?ac89:4164:1)
    at Object.invokeGuardedCallbackDev (react-dom.development.js?ac89:4213:1)
    at invokeGuardedCallback (react-dom.development.js?ac89:4277:1)
    at beginWork$1 (react-dom.development.js?ac89:27451:1)
    at performUnitOfWork (react-dom.development.js?ac89:26557:1)
    at workLoopSync (react-dom.development.js?ac89:26466:1)
    at renderRootSync (react-dom.development.js?ac89:26434:1)
    at performConcurrentWorkOnRoot (react-dom.development.js?ac89:25738:1)
    at workLoop (scheduler.development.js?bcd2:266:1)
    at flushWork (scheduler.development.js?bcd2:239:1)
    at performWorkUntilDeadline (scheduler.development.js?bcd2:533:1)
    at pageHook.js:22:13552
    at h (pageHook.js:22:13667)
    at s (pageHook.js:22:13025)
eval @ i18nextChainedBackend.js?6320:46
init @ i18nextChainedBackend.js?6320:44
Connector @ i18next.js?a850:1666
init @ i18next.js?a850:2076
eval @ browser.js?7243:14
eval @ appWithTranslation.js?deac:42
mountMemo @ react-dom.development.js?ac89:17225
useMemo @ react-dom.development.js?ac89:17670
useMemo @ react.development.js?1b7e:1650
AppWithTranslation @ appWithTranslation.js?deac:25
renderWithHooks @ react-dom.development.js?ac89:16305
mountIndeterminateComponent @ react-dom.development.js?ac89:20074
beginWork @ react-dom.development.js?ac89:21587
callCallback @ react-dom.development.js?ac89:4164
invokeGuardedCallbackDev @ react-dom.development.js?ac89:4213
invokeGuardedCallback @ react-dom.development.js?ac89:4277
beginWork$1 @ react-dom.development.js?ac89:27451
performUnitOfWork @ react-dom.development.js?ac89:26557
workLoopSync @ react-dom.development.js?ac89:26466
renderRootSync @ react-dom.development.js?ac89:26434
performConcurrentWorkOnRoot @ react-dom.development.js?ac89:25738
workLoop @ scheduler.development.js?bcd2:266
flushWork @ scheduler.development.js?bcd2:239
performWorkUntilDeadline @ scheduler.development.js?bcd2:533
(anonymous) @ pageHook.js:22
h @ pageHook.js:22
s @ pageHook.js:22
postMessage (async)
n @ pageHook.js:22
f.setImmediate @ pageHook.js:22
schedulePerformWorkUntilDeadline @ scheduler.development.js?bcd2:564
requestHostCallback @ scheduler.development.js?bcd2:588
unstable_scheduleCallback @ scheduler.development.js?bcd2:441
scheduleCallback$1 @ react-dom.development.js?ac89:27537
ensureRootIsScheduled @ react-dom.development.js?ac89:25683
scheduleInitialHydrationOnRoot @ react-dom.development.js?ac89:25558
createHydrationContainer @ react-dom.development.js?ac89:28805
hydrateRoot @ react-dom.development.js?ac89:29438
hydrateRoot$1 @ react-dom.development.js?ac89:29810
exports.hydrateRoot @ client.js?af81:20
renderReactElement @ index.js?46cb:346
doRender @ index.js?46cb:489
eval @ index.js?46cb:507
asyncGeneratorStep @ _async_to_generator.js?0e30:13
_next @ _async_to_generator.js?0e30:31
eval @ _async_to_generator.js?0e30:36
eval @ _async_to_generator.js?0e30:28
_render @ index.js?46cb:525
render @ index.js?46cb:498
eval @ index.js?46cb:639
asyncGeneratorStep @ _async_to_generator.js?0e30:13
_next @ _async_to_generator.js?0e30:31
Promise.then (async)
asyncGeneratorStep @ _async_to_generator.js?0e30:22
_next @ _async_to_generator.js?0e30:31
Promise.then (async)
asyncGeneratorStep @ _async_to_generator.js?0e30:22
_next @ _async_to_generator.js?0e30:31
Promise.then (async)
asyncGeneratorStep @ _async_to_generator.js?0e30:22
_next @ _async_to_generator.js?0e30:31
Promise.then (async)
asyncGeneratorStep @ _async_to_generator.js?0e30:22
_next @ _async_to_generator.js?0e30:31
eval @ _async_to_generator.js?0e30:36
eval @ _async_to_generator.js?0e30:28
_hydrate @ index.js?46cb:641
hydrate @ index.js?46cb:528
eval @ next-dev.js?3515:40
Promise.then (async)
eval @ next-dev.js?3515:35
./node_modules/next/dist/client/next-dev.js @ main.js?ts=1678112795225:236
options.factory @ webpack.js?ts=1678112795225:706
__webpack_require__ @ webpack.js?ts=1678112795225:37
__webpack_exec__ @ main.js?ts=1678112795225:1138
(anonymous) @ main.js?ts=1678112795225:1139
webpackJsonpCallback @ webpack.js?ts=1678112795225:1254
(anonymous) @ main.js?ts=1678112795225:9
17:26:37.508 next-dev.js?3515:20 Warning: An error occurred during hydration. The server HTML was replaced with client content in <div>. 

See more info here: https://nextjs.org/docs/messages/react-hydration-error
window.console.error @ next-dev.js?3515:20
overrideMethod @ react_devtools_backend.js:2655
printWarning @ react-dom.development.js?ac89:86
error @ react-dom.development.js?ac89:60
errorHydratingContainer @ react-dom.development.js?ac89:11473
recoverFromConcurrentError @ react-dom.development.js?ac89:25846
performConcurrentWorkOnRoot @ react-dom.development.js?ac89:25750
workLoop @ scheduler.development.js?bcd2:266
flushWork @ scheduler.development.js?bcd2:239
performWorkUntilDeadline @ scheduler.development.js?bcd2:533
(anonymous) @ pageHook.js:22
h @ pageHook.js:22
s @ pageHook.js:22
postMessage (async)
n @ pageHook.js:22
f.setImmediate @ pageHook.js:22
schedulePerformWorkUntilDeadline @ scheduler.development.js?bcd2:564
requestHostCallback @ scheduler.development.js?bcd2:588
unstable_scheduleCallback @ scheduler.development.js?bcd2:441
scheduleCallback$1 @ react-dom.development.js?ac89:27537
ensureRootIsScheduled @ react-dom.development.js?ac89:25683
scheduleInitialHydrationOnRoot @ react-dom.development.js?ac89:25558
createHydrationContainer @ react-dom.development.js?ac89:28805
hydrateRoot @ react-dom.development.js?ac89:29438
hydrateRoot$1 @ react-dom.development.js?ac89:29810
exports.hydrateRoot @ client.js?af81:20
renderReactElement @ index.js?46cb:346
doRender @ index.js?46cb:489
eval @ index.js?46cb:507
asyncGeneratorStep @ _async_to_generator.js?0e30:13
_next @ _async_to_generator.js?0e30:31
eval @ _async_to_generator.js?0e30:36
eval @ _async_to_generator.js?0e30:28
_render @ index.js?46cb:525
render @ index.js?46cb:498
eval @ index.js?46cb:639
asyncGeneratorStep @ _async_to_generator.js?0e30:13
_next @ _async_to_generator.js?0e30:31
Promise.then (async)
asyncGeneratorStep @ _async_to_generator.js?0e30:22
_next @ _async_to_generator.js?0e30:31
Promise.then (async)
asyncGeneratorStep @ _async_to_generator.js?0e30:22
_next @ _async_to_generator.js?0e30:31
Promise.then (async)
asyncGeneratorStep @ _async_to_generator.js?0e30:22
_next @ _async_to_generator.js?0e30:31
Promise.then (async)
asyncGeneratorStep @ _async_to_generator.js?0e30:22
_next @ _async_to_generator.js?0e30:31
eval @ _async_to_generator.js?0e30:36
eval @ _async_to_generator.js?0e30:28
_hydrate @ index.js?46cb:641
hydrate @ index.js?46cb:528
eval @ next-dev.js?3515:40
Promise.then (async)
eval @ next-dev.js?3515:35
./node_modules/next/dist/client/next-dev.js @ main.js?ts=1678112795225:236
options.factory @ webpack.js?ts=1678112795225:706
__webpack_require__ @ webpack.js?ts=1678112795225:37
__webpack_exec__ @ main.js?ts=1678112795225:1138
(anonymous) @ main.js?ts=1678112795225:1139
webpackJsonpCallback @ webpack.js?ts=1678112795225:1254
(anonymous) @ main.js?ts=1678112795225:9
17:26:37.510 i18nextChainedBackend.js?6320:46 Uncaught TypeError: Cannot read properties of null (reading 'init')
    at eval (i18nextChainedBackend.js?6320:46:1)
    at Array.forEach (<anonymous>)
    at Backend.init (i18nextChainedBackend.js?6320:44:1)
    at new Connector (i18next.js?a850:1666:1)
    at I18n.init (i18next.js?a850:2076:1)
    at eval (browser.js?7243:14:1)
    at eval (appWithTranslation.js?deac:42:34)
    at mountMemo (react-dom.development.js?ac89:17225:1)
    at Object.useMemo (react-dom.development.js?ac89:17670:1)
    at useMemo (react.development.js?1b7e:1650:1)
    at AppWithTranslation (appWithTranslation.js?deac:25:23)
    at renderWithHooks (react-dom.development.js?ac89:16305:1)
    at mountIndeterminateComponent (react-dom.development.js?ac89:20074:1)
    at beginWork (react-dom.development.js?ac89:21587:1)
    at HTMLUnknownElement.callCallback (react-dom.development.js?ac89:4164:1)
    at Object.invokeGuardedCallbackDev (react-dom.development.js?ac89:4213:1)
    at invokeGuardedCallback (react-dom.development.js?ac89:4277:1)
    at beginWork$1 (react-dom.development.js?ac89:27451:1)
    at performUnitOfWork (react-dom.development.js?ac89:26557:1)
    at workLoopSync (react-dom.development.js?ac89:26466:1)
    at renderRootSync (react-dom.development.js?ac89:26434:1)
    at recoverFromConcurrentError (react-dom.development.js?ac89:25850:1)
    at performConcurrentWorkOnRoot (react-dom.development.js?ac89:25750:1)
    at workLoop (scheduler.development.js?bcd2:266:1)
    at flushWork (scheduler.development.js?bcd2:239:1)
    at performWorkUntilDeadline (scheduler.development.js?bcd2:533:1)
    at pageHook.js:22:13552
    at h (pageHook.js:22:13667)
    at s (pageHook.js:22:13025)
eval @ i18nextChainedBackend.js?6320:46
init @ i18nextChainedBackend.js?6320:44
Connector @ i18next.js?a850:1666
init @ i18next.js?a850:2076
eval @ browser.js?7243:14
eval @ appWithTranslation.js?deac:42
mountMemo @ react-dom.development.js?ac89:17225
useMemo @ react-dom.development.js?ac89:17670
useMemo @ react.development.js?1b7e:1650
AppWithTranslation @ appWithTranslation.js?deac:25
renderWithHooks @ react-dom.development.js?ac89:16305
mountIndeterminateComponent @ react-dom.development.js?ac89:20074
beginWork @ react-dom.development.js?ac89:21587
callCallback @ react-dom.development.js?ac89:4164
invokeGuardedCallbackDev @ react-dom.development.js?ac89:4213
invokeGuardedCallback @ react-dom.development.js?ac89:4277
beginWork$1 @ react-dom.development.js?ac89:27451
performUnitOfWork @ react-dom.development.js?ac89:26557
workLoopSync @ react-dom.development.js?ac89:26466
renderRootSync @ react-dom.development.js?ac89:26434
recoverFromConcurrentError @ react-dom.development.js?ac89:25850
performConcurrentWorkOnRoot @ react-dom.development.js?ac89:25750
workLoop @ scheduler.development.js?bcd2:266
flushWork @ scheduler.development.js?bcd2:239
performWorkUntilDeadline @ scheduler.development.js?bcd2:533
(anonymous) @ pageHook.js:22
h @ pageHook.js:22
s @ pageHook.js:22
postMessage (async)
n @ pageHook.js:22
f.setImmediate @ pageHook.js:22
schedulePerformWorkUntilDeadline @ scheduler.development.js?bcd2:564
requestHostCallback @ scheduler.development.js?bcd2:588
unstable_scheduleCallback @ scheduler.development.js?bcd2:441
scheduleCallback$1 @ react-dom.development.js?ac89:27537
ensureRootIsScheduled @ react-dom.development.js?ac89:25683
scheduleInitialHydrationOnRoot @ react-dom.development.js?ac89:25558
createHydrationContainer @ react-dom.development.js?ac89:28805
hydrateRoot @ react-dom.development.js?ac89:29438
hydrateRoot$1 @ react-dom.development.js?ac89:29810
exports.hydrateRoot @ client.js?af81:20
renderReactElement @ index.js?46cb:346
doRender @ index.js?46cb:489
eval @ index.js?46cb:507
asyncGeneratorStep @ _async_to_generator.js?0e30:13
_next @ _async_to_generator.js?0e30:31
eval @ _async_to_generator.js?0e30:36
eval @ _async_to_generator.js?0e30:28
_render @ index.js?46cb:525
render @ index.js?46cb:498
eval @ index.js?46cb:639
asyncGeneratorStep @ _async_to_generator.js?0e30:13
_next @ _async_to_generator.js?0e30:31
Promise.then (async)
asyncGeneratorStep @ _async_to_generator.js?0e30:22
_next @ _async_to_generator.js?0e30:31
Promise.then (async)
asyncGeneratorStep @ _async_to_generator.js?0e30:22
_next @ _async_to_generator.js?0e30:31
Promise.then (async)
asyncGeneratorStep @ _async_to_generator.js?0e30:22
_next @ _async_to_generator.js?0e30:31
Promise.then (async)
asyncGeneratorStep @ _async_to_generator.js?0e30:22
_next @ _async_to_generator.js?0e30:31
eval @ _async_to_generator.js?0e30:36
eval @ _async_to_generator.js?0e30:28
_hydrate @ index.js?46cb:641
hydrate @ index.js?46cb:528
eval @ next-dev.js?3515:40
Promise.then (async)
eval @ next-dev.js?3515:35
./node_modules/next/dist/client/next-dev.js @ main.js?ts=1678112795225:236
options.factory @ webpack.js?ts=1678112795225:706
__webpack_require__ @ webpack.js?ts=1678112795225:37
__webpack_exec__ @ main.js?ts=1678112795225:1138
(anonymous) @ main.js?ts=1678112795225:1139
webpackJsonpCallback @ webpack.js?ts=1678112795225:1254
(anonymous) @ main.js?ts=1678112795225:9
17:26:37.513 next-dev.js?3515:20 The above error occurred in the <AppWithTranslation> component:

    at AppWithTranslation (webpack-internal:///./node_modules/next-i18next/dist/esm/appWithTranslation.js:34:30)
    at PathnameContextProviderAdapter (webpack-internal:///./node_modules/next/dist/shared/lib/router/adapters.js:62:11)
    at ErrorBoundary (webpack-internal:///./node_modules/next/dist/compiled/@next/react-dev-overlay/dist/client.js:301:63)
    at ReactDevOverlay (webpack-internal:///./node_modules/next/dist/compiled/@next/react-dev-overlay/dist/client.js:850:919)
    at Container (webpack-internal:///./node_modules/next/dist/client/index.js:62:1)
    at AppContainer (webpack-internal:///./node_modules/next/dist/client/index.js:197:11)
    at Root (webpack-internal:///./node_modules/next/dist/client/index.js:372:11)

React will try to recreate this component tree from scratch using the error boundary you provided, ErrorBoundary.
window.console.error @ next-dev.js?3515:20
overrideMethod @ react_devtools_backend.js:2655
logCapturedError @ react-dom.development.js?ac89:18687
callback @ react-dom.development.js?ac89:18755
callCallback @ react-dom.development.js?ac89:13923
commitUpdateQueue @ react-dom.development.js?ac89:13944
commitLayoutEffectOnFiber @ react-dom.development.js?ac89:23364
commitLayoutMountEffects_complete @ react-dom.development.js?ac89:24688
commitLayoutEffects_begin @ react-dom.development.js?ac89:24674
commitLayoutEffects @ react-dom.development.js?ac89:24612
commitRootImpl @ react-dom.development.js?ac89:26823
commitRoot @ react-dom.development.js?ac89:26682
finishConcurrentRender @ react-dom.development.js?ac89:25892
performConcurrentWorkOnRoot @ react-dom.development.js?ac89:25809
workLoop @ scheduler.development.js?bcd2:266
flushWork @ scheduler.development.js?bcd2:239
performWorkUntilDeadline @ scheduler.development.js?bcd2:533
(anonymous) @ pageHook.js:22
h @ pageHook.js:22
s @ pageHook.js:22
postMessage (async)
n @ pageHook.js:22
f.setImmediate @ pageHook.js:22
schedulePerformWorkUntilDeadline @ scheduler.development.js?bcd2:564
requestHostCallback @ scheduler.development.js?bcd2:588
unstable_scheduleCallback @ scheduler.development.js?bcd2:441
scheduleCallback$1 @ react-dom.development.js?ac89:27537
ensureRootIsScheduled @ react-dom.development.js?ac89:25683
scheduleInitialHydrationOnRoot @ react-dom.development.js?ac89:25558
createHydrationContainer @ react-dom.development.js?ac89:28805
hydrateRoot @ react-dom.development.js?ac89:29438
hydrateRoot$1 @ react-dom.development.js?ac89:29810
exports.hydrateRoot @ client.js?af81:20
renderReactElement @ index.js?46cb:346
doRender @ index.js?46cb:489
eval @ index.js?46cb:507
asyncGeneratorStep @ _async_to_generator.js?0e30:13
_next @ _async_to_generator.js?0e30:31
eval @ _async_to_generator.js?0e30:36
eval @ _async_to_generator.js?0e30:28
_render @ index.js?46cb:525
render @ index.js?46cb:498
eval @ index.js?46cb:639
asyncGeneratorStep @ _async_to_generator.js?0e30:13
_next @ _async_to_generator.js?0e30:31
Promise.then (async)
asyncGeneratorStep @ _async_to_generator.js?0e30:22
_next @ _async_to_generator.js?0e30:31
Promise.then (async)
asyncGeneratorStep @ _async_to_generator.js?0e30:22
_next @ _async_to_generator.js?0e30:31
Promise.then (async)
asyncGeneratorStep @ _async_to_generator.js?0e30:22
_next @ _async_to_generator.js?0e30:31
Promise.then (async)
asyncGeneratorStep @ _async_to_generator.js?0e30:22
_next @ _async_to_generator.js?0e30:31
eval @ _async_to_generator.js?0e30:36
eval @ _async_to_generator.js?0e30:28
_hydrate @ index.js?46cb:641
hydrate @ index.js?46cb:528
eval @ next-dev.js?3515:40
Promise.then (async)
eval @ next-dev.js?3515:35
./node_modules/next/dist/client/next-dev.js @ main.js?ts=1678112795225:236
options.factory @ webpack.js?ts=1678112795225:706
__webpack_require__ @ webpack.js?ts=1678112795225:37
__webpack_exec__ @ main.js?ts=1678112795225:1138
(anonymous) @ main.js?ts=1678112795225:1139
webpackJsonpCallback @ webpack.js?ts=1678112795225:1254
(anonymous) @ main.js?ts=1678112795225:9
17:26:37.516 react-dom.development.js?ac89:19849 Uncaught Error: There was an error while hydrating. Because the error happened outside of a Suspense boundary, the entire root will switch to client rendering.
    at updateHostRoot (react-dom.development.js?ac89:19849:1)
    at beginWork (react-dom.development.js?ac89:21615:1)
    at beginWork$1 (react-dom.development.js?ac89:27426:1)
    at performUnitOfWork (react-dom.development.js?ac89:26557:1)
    at workLoopSync (react-dom.development.js?ac89:26466:1)
    at renderRootSync (react-dom.development.js?ac89:26434:1)
    at recoverFromConcurrentError (react-dom.development.js?ac89:25850:1)
    at performConcurrentWorkOnRoot (react-dom.development.js?ac89:25750:1)
    at workLoop (scheduler.development.js?bcd2:266:1)
    at flushWork (scheduler.development.js?bcd2:239:1)
    at performWorkUntilDeadline (scheduler.development.js?bcd2:533:1)
    at pageHook.js:22:13552
    at h (pageHook.js:22:13667)
    at s (pageHook.js:22:13025)

To Reproduce

dont have time for that rn

Expected behavior

dont have time for that rn

Your Environment

{
  "name": "my-app",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "eslint \"{src,apps,libs,test}/**/*.{ts,tsx,js,jsx}\"",
    "lint:fix": "npm run lint -- --fix",
    "parse:translations": "gulp i18next",
    "antd:theme:generate": "npx @emeks/antd-custom-theme-generator",
    "schema:generate": "graphql-codegen"
  },
  "dependencies": {
    "@apollo/client": "^3.3.13",
    "@reduxjs/toolkit": "^1.9.3",
    "antd": "^5.2.3",
    "apollo-upload-client": "^14.1.3",
    "axios": "^0.27.1",
    "bignumber.js": "^9.1.1",
    "classnames": "^2.3.2",
    "cryptocons": "^1.3.3",
    "dotenv": "^16.0.3",
    "eslint-config-next": "^13.2.3",
    "eventsource": "^1.1.0",
    "graphql": "^15.5.0",
    "i18next": "^22.4.10",
    "i18next-chained-backend": "^4.2.0",
    "i18next-http-backend": "^2.1.1",
    "i18next-localstorage-backend": "^4.1.0",
    "immer": "^9.0.6",
    "js-file-download": "^0.4.12",
    "next": "^13.2.3",
    "next-i18next": "^13.2.1",
    "next-redux-wrapper": "^8.1.0",
    "qrcode": "^1.5.1",
    "rc-table": "^7.30.4",
    "react": "^18.2.0",
    "react-dom": "^18.2.0",
    "react-i18next": "12.2.0",
    "react-redux": "^8.0.5",
    "react-window": "^1.8.8",
    "redux": "^4.2.1",
    "shipit-npm": "^0.2.0",
    "styled-components": "^5.2.3",
    "translation-check": "^1.0.2"
  },
  "devDependencies": {
    "@faker-js/faker": "^7.6.0",
    "@graphql-codegen/cli": "^1.21.3",
    "@graphql-codegen/typescript": "^1.21.1",
    "@graphql-codegen/typescript-apollo-client-helpers": "^1.1.4",
    "@graphql-codegen/typescript-operations": "^1.17.15",
    "@types/apollo-upload-client": "^14.1.0",
    "@types/eventsource": "^1.1.6",
    "@types/qrcode": "^1.5.0",
    "@types/react": "17.0.2",
    "@types/react-window": "^1.8.5",
    "@types/styled-components": "^5.1.9",
    "@typescript-eslint/eslint-plugin": "^4.33.0",
    "@typescript-eslint/parser": "^4.33.0",
    "apollo": "^2.32.5",
    "eslint": "^7.23.0",
    "eslint-config-prettier": "^8.5.0",
    "eslint-import-resolver-typescript": "^3.5.2",
    "eslint-plugin-eslint-comments": "^3.2.0",
    "eslint-plugin-import": "^2.26.0",
    "eslint-plugin-jsx-a11y": "^6.6.1",
    "eslint-plugin-prettier": "^4.2.1",
    "eslint-plugin-react": "^7.31.11",
    "eslint-plugin-react-hooks": "^4.6.0",
    "eslint-plugin-simple-import-sort": "^7.0.0",
    "gulp": "^4.0.2",
    "i18next-parser": "^7.7.0",
    "prettier": "^2.8.4",
    "shipit-cli": "^5.3.0",
    "shipit-deploy": "^5.3.0",
    "typescript": "^4.5.3"
  }
}

i18next config

const HttpBackend = require('i18next-http-backend').default;
const ChainedBackend = require('i18next-chained-backend').default;
const LocalStorageBackend = require('i18next-localstorage-backend').default;
// dont work in nextjs, dont have time for that to resolve rn
// const i18nextPluginTranslationCheck = require('translation-check').i18nextPlugin

const isBrowser = typeof window !== 'undefined';

module.exports = {
  // debug: true,
  i18n: {
    defaultLocale: 'ru',
    locales: ['en', 'ru'],
  },
  use: isBrowser ? [ChainedBackend] : [],
  backend: {
    backendOptions: [
      {
        expirationTime: process.env.NODE_ENV === 'development'
          ? 1
          : 60 * 60 * 1000, // 1 hour
      },
      {
        loadPath: `${process.env.BASE_URL}/localizations/{{lng}}/{{ns}}.json`,
      },
    ],
    backends: isBrowser ? [LocalStorageBackend, HttpBackend] : [],
  },
  serializeConfig: false,
  // saveMissing: true // to not saveMissing to true for production
  returnNull: false,
};
adrai commented 1 year ago

Sorry, not able to reproduce it. This seems to work with all latest versions: https://github.com/i18next/i18next-http-backend/tree/master/example/next

Closing it if no reproducible example is provided... (I also have no time for guessing your code setup)

Naggertooth commented 1 year ago

Seems like not chained backend issue, sorry May be later will fix it or make a bit more reproduce-able example

Ty for focus link btw