Cloudflare Removing my variables from runtime everytime
Hey cloudflare is removing my variables after 2-3 build finishes i dont know why its happening i added variables 5 times now and im sad about it anyone else getting this issue?
i was deploying my nextjs website on workers

19 Replies
Are the variables present in your
wrangler.json?no i dont have that file
or you mean
wrangler.toml?
i have wrangler.toml
if i add all my variables inside wrangler.toml isnt that will go into github and reveal my variablesIf you have some variables you want to keep secret, then you should use Secrets. Those also shouldn't disappear on redeploy
its. disappearing
thats confusing me
To confirm, once you have added a Secret, do you see "Value Encrypted"?
i didnt added anything in store secrets
im adding them in Settings > variables and secrets

Yeah, that's fine. If you add one, does it show the value, or does it say "Encrypted"?
also there is a build time secrets they stay as it is only runtime secrets gets vanished

let me see by adding again
its displays like this

value is raw value
That's the issue. When adding a variable, you need to set
Type: Secret, not Textaah
do i need to add both build time and runtime secrets separated?
Secrets are just for runtime, in this case anyway
yea but like i still have to add 2 times
if i had to add a new variable
in future
thanks for noting this! not sure if it's possible to leave feedback for the Workers team here, but it would be very nice if this were communicated more clearly in the dashboard... this same issue kind of bit my ass in production today
You can put it as feedback in #workers-and-pages-feature-suggestions? It's not really a feature, but I'd say it still counts
Thanks!