How to fetch data at build time for static deployment on Cloudflare Workers?
I’m using TanStack Start and deploying my site to Cloudflare Workers.
I want to fetch some data at build time so it becomes static in the deployed site.
From what I can tell, Static Server Functions won’t work in the Cloudflare Workers environment. Is there a recommended way to fetch data during the build step and have it baked into the static output when deploying?
Basically:
- I want the data to be part of the built site, not fetched at runtime.
- I’m deploying to Cloudflare Workers, so I can’t rely on server-side execution.
Any advice or best practices for handling this use case in TanStack Start?
4 Replies
sensitive-blue•4w ago
we are working on making prerendering available for cloudflare. stay tuned
afraid-scarlet•2w ago
@Manuel Schiller also not working on Vercel right? Would be nice to have a line in the docs about the types of deployments supported
sensitive-blue•2w ago
no known issues with vercel here
afraid-scarlet•2w ago
Calling this function seems to generate an error:
When deploying on vercel.
forntend console
this is where it is called: