© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
Cloudflare DevelopersCD
Cloudflare Developers•3y ago•
6 replies
bdematt

Access bindings in dev

I'm following this tutorial:
https://developers.cloudflare.com/pages/framework-guides/deploy-a-svelte-site/

And I've also tried the Qwik tutorial. I'm running the dev server using
npm run pages:dev
npm run pages:dev
so using wrangler. In the case of Qwik, in the console I can see the message:
Your worker has access to the following bindings:
- D1 Databases:
  - DB: ...
Your worker has access to the following bindings:
- D1 Databases:
  - DB: ...


But the context is not provided to the request handler. In the case of Svelte,
export async function post(context) {
  const env = context.platform.env // This is undefined
}
export async function post(context) {
  const env = context.platform.env // This is undefined
}


The SvelteKit docs do say "platform.env is only available in the final build and not in dev mode." But I'm not sure how anyone is doing development without the bindings. Just build every time I want to test?

Am I missing something? Anyone have any suggestions or workaround?
Deploy a Svelte site · Cloudflare Pages docs
Svelte is an increasingly popular, open-source framework for building user interfaces and web applications. Unlike most frameworks, Svelte is …
Deploy a Svelte site · Cloudflare Pages docs
SvelteKit docs
Cloudflare Pages • SvelteKit documentation
SvelteKit docs
Cloudflare Developers banner
Cloudflare DevelopersJoin
Welcome to the official Cloudflare Developers server. Here you can ask for help and stay updated with the latest news
85,042Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Can't access RPC Service Bindings in local (next dev)
Cloudflare DevelopersCDCloudflare Developers / pages-help
2y ago
SvelteKit service bindings in local development
Cloudflare DevelopersCDCloudflare Developers / pages-help
2y ago
Use Service Bindings in local development
Cloudflare DevelopersCDCloudflare Developers / pages-help
3y ago
KV access in a Sveltekit dev environment
Cloudflare DevelopersCDCloudflare Developers / pages-help
3y ago