Massively slow or failing "Generating static pages"

Hi, I’ve been working on a website for years and have recently rewritten it to try and take advantage of the partial prerendering feature. I wasn’t aware that it was only available in Next15, due to this, my app running on 14 was slow to initially render (not high traffic so cold starts seem to happen frequently).

Anyway, that’s a little context for why I’m wanting to use Next15 despite it being canary; The issue that I’m experiencing is a failure in the Generating static pages section of building the app, which exceedes 60s (I tried to increase it to 5 minutes, also failed).

It is only the build on Vercel that fails, it builds correctly on my computer.

Here’s the error

> Build error occurred
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
    at onRestart (/vercel/path0/node_modules/.pnpm/next@15.0.0-canary.87_@babel+core@7.24.7_@opentelemetry+api@1.9.0_react-dom@19.0.0-rc.0_react_mwvtfgx4wioiun7wdew3d5ckci/node_modules/next/dist/build/index.js:280:27)
    at /vercel/path0/node_modules/.pnpm/next@15.0.0-canary.87_@babel+core@7.24.7_@opentelemetry+api@1.9.0_react-dom@19.0.0-rc.0_react_mwvtfgx4wioiun7wdew3d5ckci/node_modules/next/dist/lib/worker.js:98:40
    at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
    at async /vercel/path0/node_modules/.pnpm/next@15.0.0-canary.87_@babel+core@7.24.7_@opentelemetry+api@1.9.0_react-dom@19.0.0-rc.0_react_mwvtfgx4wioiun7wdew3d5ckci/node_modules/next/dist/export/index.js:415:28
    at async Span.traceAsyncFn (/vercel/path0/node_modules/.pnpm/next@15.0.0-canary.87_@babel+core@7.24.7_@opentelemetry+api@1.9.0_react-dom@19.0.0-rc.0_react_mwvtfgx4wioiun7wdew3d5ckci/node_modules/next/dist/trace/trace.js:157:20)
    at async /vercel/path0/node_modules/.pnpm/next@15.0.0-canary.87_@babel+core@7.24.7_@opentelemetry+api@1.9.0_react-dom@19.0.0-rc.0_react_mwvtfgx4wioiun7wdew3d5ckci/node_modules/next/dist/export/index.js:413:26
    at async Promise.all (index 6)
    at async exportAppImpl (/vercel/path0/node_modules/.pnpm/next@15.0.0-canary.87_@babel+core@7.24.7_@opentelemetry+api@1.9.0_react-dom@19.0.0-rc.0_react_mwvtfgx4wioiun7wdew3d5ckci/node_modules/next/dist/export/index.js:400:21)
    at async /vercel/path0/node_modules/.pnpm/next@15.0.0-canary.87_@babel+core@7.24.7_@opentelemetry+api@1.9.0_react-dom@19.0.0-rc.0_react_mwvtfgx4wioiun7wdew3d5ckci/node_modules/next/dist/export/index.js:616:16
    at async Span.traceAsyncFn (/vercel/path0/node_modules/.pnpm/next@15.0.0-canary.87_@babel+core@7.24.7_@opentelemetry+api@1.9.0_react-dom@19.0.0-rc.0_react_mwvtfgx4wioiun7wdew3d5ckci/node_modules/next/dist/trace/trace.js:157:20)
Error: Command "next build" exited with 1

I’m not entirely sure how to debug this issue, I think it’s probably a configuration issue with something, but I’m unable to check where it is failing from the above stack trace.

I was able to get the site building again partially (now with some issues in a server component failing with [GET] /menu/[menu_item].prefetch.rsc status=504 and Task timed out after 10.01 seconds being the only output in the logs tab.

I’ve had to rollback to the last working version, meaning that I can’t push any updates to fix anything. Thanks for any help, I’d be happy to add anyone to the private repo for the site if required, or to look through all the build logs.

Hi, @kieranholroyd!

Did you try the possible fixes outlined in this document?

Yes, to the best of my ability, and as stated above, the main issue is actually that I can’t debug this issue, as it runs on my machine (yeah, I know). It should make a single, or possibly two requests to a turso db, and upstash redis (was using the vercel adapter, switched to upstash client, didn’t change anything).

The thing I’m a little confused about with this whole issue, is that the “static page” generated with partial prerendering shouldn’t pull the data surely? as the whole idea is that you have loading states (loading.tsx/suspense), which I’ve implemented, my expectation would be that it shouldn’t be making a request, yet it seems to be the case that it is (I can see upstash being hit on build, under a staging environment).

With all that said, the build step failed on v14 & 15-rc, and when I managed through dumb luck? to get it to build on v14, the function times out on an individual page, but the combined page loads fine, even when they are getting the data from the exact same table, and it’s stored the same way in Redis.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.