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
No description
19 Replies
Hard@Work
Hard@Work6mo ago
Are the variables present in your wrangler.json?
Gurbinder
GurbinderOP6mo ago
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 variables
Hard@Work
Hard@Work6mo ago
If you have some variables you want to keep secret, then you should use Secrets. Those also shouldn't disappear on redeploy
Gurbinder
GurbinderOP6mo ago
its. disappearing thats confusing me
Hard@Work
Hard@Work6mo ago
To confirm, once you have added a Secret, do you see "Value Encrypted"?
Gurbinder
GurbinderOP6mo ago
i didnt added anything in store secrets
Gurbinder
GurbinderOP6mo ago
im adding them in Settings > variables and secrets
No description
Hard@Work
Hard@Work6mo ago
Yeah, that's fine. If you add one, does it show the value, or does it say "Encrypted"?
Gurbinder
GurbinderOP6mo ago
also there is a build time secrets they stay as it is only runtime secrets gets vanished
No description
Gurbinder
GurbinderOP6mo ago
let me see by adding again
Gurbinder
GurbinderOP6mo ago
its displays like this
No description
Gurbinder
GurbinderOP6mo ago
value is raw value
Hard@Work
Hard@Work6mo ago
That's the issue. When adding a variable, you need to set Type: Secret, not Text
Gurbinder
GurbinderOP6mo ago
aah do i need to add both build time and runtime secrets separated?
Hard@Work
Hard@Work6mo ago
Secrets are just for runtime, in this case anyway
Gurbinder
GurbinderOP6mo ago
yea but like i still have to add 2 times if i had to add a new variable in future
turtlebasket
turtlebasket6mo ago
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
Hard@Work
Hard@Work6mo ago
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
turtlebasket
turtlebasket6mo ago
Thanks!

Did you find this page helpful?