Browse Source

fix(app): await App.getInitialProps in _app

Without await, App.getInitialProps returns a Promise that is spread
into the result, producing no enumerable properties. pageProps ends
up undefined, which crashes deserializeSuperJSONProps with
"Cannot read properties of undefined (reading '_superjson')".

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Shun Miyazawa 4 days ago
parent
commit
b0bc679fd5
1 changed files with 1 additions and 1 deletions
  1. 1 1
      apps/app/src/pages/_app.page.tsx

+ 1 - 1
apps/app/src/pages/_app.page.tsx

@@ -112,7 +112,7 @@ function GrowiApp(props: GrowiAppProps): JSX.Element {
 
 // inject userLocale by context
 GrowiApp.getInitialProps = async (appContext: AppContext) => {
-  const appProps = App.getInitialProps(appContext);
+  const appProps = await App.getInitialProps(appContext);
   const userLocale = getLocaleAtServerSide(
     appContext.ctx.req as unknown as CrowiRequest,
   );