Reload the app when .env file is edited
See original GitHub issueDescription
The environment variables are not being loaded correctly
Expected behavior
I want to use process.env
+ .env
file to load my environment variables.
Actual behavior
I’m trying to use process.env
but it have just an empty Object
.
The NODE_ENV
doesn’t exist either.
Environment
Run these commands in the project folder and fill in their results:
npm ls react-scripts
(if you haven’t ejected): └── react-scripts@0.6.1node -v
: v6.7.0npm -v
: 3.10.8
Then, specify:
- Operating system: Windows 10 Pro
- Browser and version: Chrome 53.0.2785.143 m
Issue Analytics
- State:
- Created 7 years ago
- Reactions:2
- Comments:11 (7 by maintainers)
Top Results From Across the Web
React reload .env variables after Changing them
in my react app I have a .env file and every time I change them I can't see the change until I stop...
Read more >How To Enable Hot Reloading for .env Files in Next.js
In this article, you learned how to enable hot loading of .env files on Next.js. Finally, Next.js has extended the Fast Refresh feature...
Read more >Breaking: Fast Refresh for .env files in Next.js 12.3
Hot Reload generally reloads the whole app on change of a file. Fast Refresh only reloads the file that is changed. If you...
Read more >how to make changes in .env file without reloading server
I am using a form from front end to change my .env file variable values, after changing the values, changes are being saved...
Read more >Environment Variables | Best Practices | PM2 Documentation
... pm2 restart app --update-env. Ecosystem process file. Any time you change the ecosystem process file, the environment variables will be updated.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@mikefrancis I don’t know why, but I have closed the
cmd
(terminal
for Linux/OSX) and reopened and it started working.Just to warn you, when you make changes to the
.env
file you have to stop the application and runnpm start
again.Hope this helps you and another person in the future.
This is the behavior I’d like to see.