Astro + Pages build fails prerendering static routes

For Workers & Pages, what is the name of the domain?

n/a

What is the error number?

[build] Failed to call getStaticPaths

What is the error message?

[ERROR] [build] Failed to call getStaticPaths for src/pages/[…permalink].astro ; fetch failed

What is the issue or error you’re encountering

Prerendering static routes works locally, but fails on CF pages build…

What steps have you taken to resolve the issue?

I’ve cleared the build cache, retried, disabled build cache, retried, deleted package-lock.json and reinstalled everything and redeployed. None of this worked.

Very perplexing, as it worked just two days ago.

[ERROR] [build] Failed to call getStaticPaths for src/pages/[…permalink].astro
13:42:12.953 fetch failed
13:42:12.953 Location:
13:42:12.953 /opt/buildhome/repo/node_modules/astro/dist/core/render/route-cache.js:29:17
13:42:12.954 Stack trace:
13:42:12.954 at Object.fetch (node:internal/deps/undici/undici:11576:11)
13:42:12.954 at async Object.request (file:///opt/buildhome/repo/dist/worker.js/pages/—permalink_.astro.mjs?time=1734028922649:42:4362)
13:42:12.954 at async callGetStaticPaths (file:///opt/buildhome/repo/node_modules/astro/dist/core/render/route-cache.js:29:17)
13:42:12.954 at async generatePage (file:///opt/buildhome/repo/node_modules/astro/dist/core/build/generate.js:149:19)
13:42:12.954 at async staticBuild (file:///opt/buildhome/repo/node_modules/astro/dist/core/build/static-build.js:94:5)
13:42:12.954 Caused by:
13:42:12.954 Connect Timeout Error
13:42:12.954 at onConnectTimeout (/opt/buildhome/repo/node_modules/wrangler/wrangler-dist/cli.js:6054:29)
13:42:12.954 at Immediate._onImmediate (/opt/buildhome/repo/node_modules/wrangler/wrangler-dist/cli.js:6042:13)
13:42:12.985 Failed: Error while executing user command. Exited with error code: 1

This error does not occur locally, nor on netlify.