Development and deployment on Cloudflare (Pages)
I thought creating a Cloudflare thread could be helpful to myself and others in the future.
I currently use https://github.com/nekochan0122/tanstack-start-with-cf-pages-env-vars in order to have a successful Cloudflare deployment with variables.
This works for variable bindings both in dev and when deployed, but other bindings, such as D1, do not work in dev (using
vinxi dev
)
Looking for an easier, more native solution. Has anyone had luck with the following?: https://nitro.build/deploy/providers/cloudflare#direct-access-to-cloudflare-bindingsGitHub
GitHub - nekochan0122/tanstack-start-with-cf-pages-env-vars
Contribute to nekochan0122/tanstack-start-with-cf-pages-env-vars development by creating an account on GitHub.
Cloudflare - Nitro
Deploy Nitro apps to Cloudflare.
7 Replies
generous-apricotOP•10mo ago
Surfacing this solution while waiting for a better one: https://discord.com/channels/719702312431386674/1238170697650405547/1309541781632974980
other-emerald•9mo ago
I am still a bit stuck on how to use the bindings with TanStack Start, Cloudflare Pages and Cloudflare D1.
generous-apricotOP•9mo ago
Have you tried the setup shown in the repo I linked?
other-emerald•9mo ago
I haven't but from your message I understand this doesn't work for bindings like D1 for development which is what I was trying to achieve.
generous-apricotOP•9mo ago
I got local D1 working by doing this: https://discord.com/channels/719702312431386674/1238170697650405547/1309541781632974980
extended-salmon•9mo ago
I was hardstuck and in the end the problem was that I was using bun
other-emerald•9mo ago
Thanks @Mozzy that is indeed what I still needed