SvelteKit private environment variables not exported.

Hello! During when my project is being built, I get errors like this:
src/lib/file.ts (1:9): "PRIVATE_ENVIRONMEN_VARIABLE" is not exported by "virtual:$env/static/private", imported by "src/lib/file.ts"
src/lib/file.ts (1:9): "PRIVATE_ENVIRONMEN_VARIABLE" is not exported by "virtual:$env/static/private", imported by "src/lib/file.ts"
My sveltekit project builds fine locally, maybe because I actually have a .env file. On CF Pages, I set the environment variables in the settings to the same as my local, but it looks like it's not able to find them during the build. I've looked around I saw that people have put the environment variables file into their github repo, but I wanted to ask here if there was another solution. I'm currently don't have an .env in my repo.
0 Replies
No replies yetBe the first to reply to this messageJoin

Did you find this page helpful?