© 2026 Hedgehog Software, LLC

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

Pages, Sveltekit and Environment variables

Hello,
I'm trying to use Cloudflare pages to deloy our web application.
However I'm getting errors in the build for each env var, public or private.
Error: Module '"$env/static/public"' has no exported member 'PUBLIC_SUPABASE_URL'. 
Error: Module '"$env/static/public"' has no exported member 'PUBLIC_SUPABASE_URL'. 

I've tried adding these in both the
wrangler.tom
wrangler.tom
and in the
settings > environment variables
settings > environment variables
tab. Neither has any effect on the build errors.

My build command, from the
package.json
package.json
file is
"build": "npx svelte-kit sync && npx svelte-check && vite build",
"build": "npx svelte-kit sync && npx svelte-check && vite build",


Any help is appreciated.

----
It seems many others are having the same problem and no one has found a solution.
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
Recent Announcements

Similar Threads

Was this page helpful?

Similar Threads

SvelteKit private environment variables not exported.
Cloudflare DevelopersCDCloudflare Developers / pages-help
14mo ago
Bun and Environment Variables - how?
Cloudflare DevelopersCDCloudflare Developers / pages-help
2y ago
Nuxt JS on Pages environment variables not working
Cloudflare DevelopersCDCloudflare Developers / pages-help
3y ago
Environment variables dissappeared ??
Cloudflare DevelopersCDCloudflare Developers / pages-help
11mo ago