Build error when using adapter-cloudflare-workers
I am currently trying to deploy a sveltekit website with Cloudflare workers using Cloudflare KV.
I've followed this guide https://kit.svelte.dev/docs/adapter-cloudflare-workers
I tried building with @sveltejs/adapter-cloudflare:2.3.3 and that works fine, however event.platform.env does not contain Cloudflare KV, even though the .toml file is specified along with the app.d.ts
Anyone have any clue?
SvelteKit docs
Cloudflare Workers • SvelteKit documentation
2 Replies
Just created a minimal reproducible environment
https://github.com/socketopp/cf-worker-sveltekit-bug
Looks like you're using the old Workers Sites setup, not Pages. I'm not sure if you want to use Pages or not but you are posting in the Pages Help, so I suggest following this guide https://kit.svelte.dev/docs/adapter-cloudflare
SvelteKit docs
Cloudflare Pages • SvelteKit documentation