SvelteKit D1 example works in local but not after deployed to Cloudflare pages
I can get data from D1 in local:
but when I deploy to Cloudflare Pages via Gitlab CI, I just got an empty exception without error.
This is my code
src/routes/api/customers/+server.ts
:
response from local:
response when deployed on Cloudflare Pages:
And I already added the D1 database binding variables on the Cloudflare Pages Settings
Not sure what did I miss, thanks.3 Replies
Solved by downgrading from Wrangler v3.5.1 to v3.4
ref: https://discord.com/channels/595317990191398933/1143320178189406278/1143322374649942176
Thanks @ryanlee7537 , scratching my head off today for this 🙏
@ryanlee7537 Does local dev with bindings work for you without the 4-5 seconds delay of completely rebuilding and using wrangler pages dev? For me this takes 5 seconds and I then have to manually refresh the page (loosing so much of sveltekit's advantages)