diff --git a/front/apps/web/src/i18n.tsx b/front/apps/web/src/i18n.tsx index 2a796455..af53fc3a 100644 --- a/front/apps/web/src/i18n.tsx +++ b/front/apps/web/src/i18n.tsx @@ -47,7 +47,7 @@ export const withTranslations = ( ...commonOptions, lng: props.pageProps.__lang, }); - i18next.systemLanguage = props.pageProps.__sysLang; + i18next.systemLanguage = props.pageProps?.__sysLang; return i18next; }); @@ -66,6 +66,7 @@ export const withTranslations = ( lng, }); i18n.systemLanguage = sysLng; + props.pageProps ??= {}; props.pageProps.__lang = lng; props.pageProps.__sysLang = sysLng; return props; diff --git a/front/apps/web/src/pages/_app.tsx b/front/apps/web/src/pages/_app.tsx index 28db2a8c..68018b3d 100755 --- a/front/apps/web/src/pages/_app.tsx +++ b/front/apps/web/src/pages/_app.tsx @@ -264,12 +264,12 @@ App.getInitialProps = async (ctx: AppContext) => { ) { ctx.ctx.res!.writeHead(307, { Location: `/setup?step=${info!.setupStatus}` }); ctx.ctx.res!.end(); - return {} as any; + return { pageProps: {} }; } if (info!.setupStatus === SetupStep.Done && ctx.router.route === "/setup") { ctx.ctx.res!.writeHead(307, { Location: "/" }); ctx.ctx.res!.end(); - return {} as any; + return { pageProps: {} }; } } catch (e) { console.error("SSR error, disabling it.");