What causes a .env file not to be read? I have variables in it and apparently it’s not being read, I replaced the variables with passwords and it works.... soooo the variables loading is the problem. What causes that? I’m using react
For further actions, you may consider blocking this person and/or reporting abuse
Top comments (6)
How are you running the application?
Are you setting them as variables in your machine? echo them from the bash to see if they are indeed being applied.
If you can't access anything in your .env please check the dotenv npm package.
Hope this helps!
How do I echo them? I have the env “ignored” because I’m using GitHub. I have the package installed. I’ve tried “REACT_APP” I front of all the variables as a test, still didn’t work
hmm, thats indeed weird. Is your repo public by any chance?
No, it’s private. But I was told you still create variables
Yes of course. Just meant it because if it was public I could check what was wrong. Echoing is just as easy as having a dummy script with echo $YOUR_ENV_VAR
I have a repo, but that project is private because I have API keys