Demonstration of an issue with Cloudflare D1 in a SvelteKit app.
It actually works now with the --bundle flag.
Run wrangler pages publish .svelte-kit/cloudflare --bundle to try it.
wrangler installed locally and are logged in.npm install.wrangler d1 create d1-sveltekit-repro-db.wrangler kv:namespace create kv. This is used
as a smoke test to prove that bindings in general do work.npm run build.wrangler pages publish .svelte-kit/cloudflare.KV=d1-sveltekit-repro-kvDB=d1-sveltekit-repro-dbwrangler pages publish .svelte-kit/cloudflare.Now you can check the three different API routes to see what works and doesn't (change the domain to your project).
wrangler d1 execute d1-sveltekit-repro-db --command 'SELECT name FROM sqlite_schema')
but it results in an internal error here.