SPA mode error when deploying to CF
im getting a
TypeError: Cannot read properties of undefined (reading 'compatibilityFlags') error when deploying to CF with start when i enable SPA mode with these settings:
reverting the commit makes it work again
any ideas why this happens?
Also noticed that ssr is set to true under the CF plugin as based on the deployement guide
Could this be the reason? Any way to deploy start to CF with ssr set to false?10 Replies
rare-sapphire•2w ago
@Cloudflare (Partner)
where does this error occur?
locally?
other-emeraldOP•2w ago
during the build on cf
rare-sapphire•2w ago
so thats a good question for our cloudflare colleagues here then
other-emeraldOP•2w ago
thanks, i'll also try crossposting on the cf server
ratty-blush•2w ago
SPA mode does prerendering and this doesn't currently work with Cloudflare because Start prerenders in Node. The error is because Node is trying to access a value that only exists in the Workers runtime. We are currently working together on a solution to make prerendering runtime agnostic so that routes will be prerendered in the target runtime.
other-emeraldOP•2w ago
I see, thanks!
cloudy-cyan•5d ago
Any timeline on this? Are there any current workarounds?
rare-sapphire•5d ago
its implemented already
cloudy-cyan•5d ago
Is there a deployment guide to Cloudflare pages?
extended-salmon•2d ago
We would advise you use Cloudflare workers to deploy Tanstack start rather than Pages. We have a
npm create cloudflare starter generator that has a TanStack Start project bootstrap.