You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've got some weird behaviour and I'm struggling to pin it down. In the dev server, I keep getting the values of slug in place of the locale/lang variable.
Console output:
- wait compiling /[lang]/page (client and server)...
- warn ./i18n.js
Critical dependency: the request of a dependency is an expression
Import trace for requested module:
./i18n.js
./app/[lang]/page.tsx
loadLocaleFrom(locale, namespace) ::: { locale: 'about', namespace: 'common' }
Error: Cannot find module './about/common.json'
at /Users/jpozivil/Sites/visas/var/www/static-visas/mono-repo-visas/apps/web/out/southkorea/southkorea1/server/app/[lang]/page.js:120:12
at runNextTicks (node:internal/process/task_queues:61:5)
at processTimers (node:internal/timers:499:9)
at async Promise.all (index 0) {
code: 'MODULE_NOT_FOUND'
}
loadLocaleFrom(locale, namespace) ::: { locale: 'about', namespace: 'common' }
next-translate - compiled page: /[lang] - locale: about - namespaces: common - used loader: server /page
Error: Cannot find module './about/common.json'
at /Users/jpozivil/Sites/visas/var/www/static-visas/mono-repo-visas/apps/web/out/southkorea/southkorea1/server/app/[lang]/page.js:120:12
at runNextTicks (node:internal/process/task_queues:61:5)
at processTimers (node:internal/timers:499:9)
at async Promise.all (index 0) {
code: 'MODULE_NOT_FOUND'
}
next-translate - compiled page: /[lang] - locale: about - namespaces: common - used loader: server /layout
loadLocaleFrom(locale, namespace) ::: { locale: 'about', namespace: 'common' }
loadLocaleFrom(locale, namespace) ::: { locale: 'about', namespace: 'common' }
Error: Cannot find module './about/common.json'
at /Users/jpozivil/Sites/visas/var/www/static-visas/mono-repo-visas/apps/web/out/southkorea/southkorea1/server/app/[lang]/page.js:120:12
at async Promise.all (index 0) {
code: 'MODULE_NOT_FOUND'
}
/* i18n.js */module.exports={allowEmptyStrings: false,// Set to false force using keys as valuesdefaultLocale: 'en-US',keySeparator: false,// Disable separator for nested keys in JSON translation files. Useful to use natural text as keys.localeDetection: false,// To prevent Next.js detect the browser language to decide the languagelocales: ['en-US','ja-JP'],nsSeparator: false,// Disable translations namespacingdefaultNS: 'common',pages: {'*': ['common'],},loadLocaleFrom: (locale,namespace)=>{console.log('loadLocaleFrom(locale, namespace) ::: ',{
locale,
namespace,});returnimport(`../../../my-special-path/locales/${locale}/${namespace}.json`).then((m)=>m.default).catch((err)=>console.error(err));},};
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Problem Description
I've got some weird behaviour and I'm struggling to pin it down. In the dev server, I keep getting the values of slug in place of the locale/lang variable.
Console output:
And this keeps repeating/loading indefinitelly.
Browser output:
My Setup
app
routerMy Code
Beta Was this translation helpful? Give feedback.
All reactions