_app

Stale Environment Varaibles. Hey everyone, I had a quick question about stale environment variables when using CT3A. For some reason when I update my .env file it seems like I have stale variables and the updates don't take effect. I tested this with printenv and it seems my current work around is to - remove yarn.lock - remove node_modules - run cache clean - reinstall node_modules this seems to work, but it's a pain. Any thoughts? Suggestions? Thanks
5 Replies
theo (t3.gg)
theo (t3.gg)3y ago
Updating .env will not trigger a fresh env That’s not how env variables work
Gaurang
Gaurang3y ago
I get that we need to restart the server for the new variables to be injected into the environment, but again, that is not happening here for some odd reason. Like i said I had to reinstall the deps & clean the cache for the changes to take effect. also thanks for the quick reply!! I just updated the EMAIL_FROM varaible - restarted the server and ran printenv in the terminal on the right. Also showing my updated .env and schema.mjs files
Gaurang
Gaurang3y ago
Gaurang
Gaurang3y ago
nvm i just realized it might be my global dotenv settings that are causing this issue, starting a new terminal instance solves the problem for me. thanks again for the quick response!
Christoph
Christoph3y ago
Use console.log(process.env) instead of printenv - Starting the server doesnt change your terminals environment variables It only merges the terminals env variables with the ones you have defined in your .env in process.env
Want results from more Discord servers?
Add your server