Next.js Discord

Discord Forum

Static Site Generation Timeout - Not replicable in localhost

Unanswered
Yellow-throated Vireo posted this in #help-forum
Open in Discord
Yellow-throated VireoOP
Hey all - I'm having the following error when running build

Error: Static page generation for / is still timing out after 3 attempts. See more info here https://nextjs.org/docs/messages/static-page-generation-timeout


When doing build in localhost, there's no issues. To my knowledge, the .env configs are the same in both environments. I've made the timeout longer but the issue persists.

Here's a snippet to the getStaticProps of the failing path
export const getStaticProps: GetStaticProps = async () => {
  const ssg = createServerSideHelpers({
    router: appRouter,
    ctx: await createContext({
      req: undefined as any as NextApiRequest,
      res: undefined as any as NextApiResponse,
    }),
    transformer: superjson,
  })
  await Promise.all(
    [
      'BELLEZA',
      GROUP_CATEGORIES_GENDER[0].url,
      GROUP_CATEGORIES_GENDER[1].url,
      GROUP_CATEGORIES_GENDER[2].url,
      GROUP_CATEGORIES_GENDER[3].url,
    ]
      .map((categoryPrefix) =>
        ssg.catalog.product.findMany.prefetch({
          filters: { [GetProductsFilterType.CATEGORY_PREFIX]: categoryPrefix },
          cursor: 0,
        }),
      )
      .concat([ssg.catalog.category.findMany.prefetch()]),
  )
  return {
    props: {
      SEOProperties: {
        urlPath: '/',
      },
      trpcState: ssg.dehydrate(),
    },
    revalidate: REVALIDATE_HOME_PAGE_INTERVAL,
  }
}

0 Replies