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'. 

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

My build command, from the
package.json
file is "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.
Was this page helpful?