My .env values are not being updated consistently -- caching or not writing by WebStorm?
This is a long shot -- and to be clear, I don't think WebStorm is at fault here -- but I've been having problems where changes in my .env variables are not being reflected in run-time, that is, if I change a value in my .env file, the old value persists at run-time (after re-starting the app). Full details are here -- https://stackoverflow.com/questions/61757752/nodejs-env-variables-using-dotenv-are-not-submitting-to-change-cached?noredirect=1#comment109257633_61757752
Someone suggested that perhaps there might be some issue with WebStorm not writing the files correctly or consistently -- that is, that in some way it was caching them, that is, that 'smart save' or something like that might not be writing the file all the time. I thought I'd ask here if in any way WebStorm might be involved in the issue.
I'm running WS 2020.1, on MacOS 10.14, with Node 12.14.0
Please sign in to leave a comment.
The IDE is not caching the .env files for sure. But if your environment (bundlers/transpilers/etc, any code that is watching your files for changes) has problems dealing with the
safe write
(when files are saved to a temporary location first before the originals are overwritten), you might need to disable this feature in IDE settings,Settings > Appearance & Behavior > System Settings > Use "safe write" (save changes to a temporary file first)
It would seem it's probably (although not definitely) something to do with KeystoneJS -- I can't get a final answer....
I also seem to struggle with a similar issue as desciobed in the initial post.
Now I wonder about the "latest labelling" / name of what has been mentioned by Elena Pogorelova
I can find "Settings > Appearance & Behavior > System Settings >" ... but the "Use "safe write" (save changes to a temporary file first)" - I'm not sure which option that would be.
I use IntelliJ IDEA 2022.2.2 (Ultimate Edition), Build #IU-222.4167.29, built on September 13, 2022
The option is now called Back up files before saving, see Help, Autosave