Comments (3)
this should probably be the default, without an extra flag
from node.
--watch-path=.env
doesn't help either. It does restart the script when the env file changes, however the env file is not loaded again, so the script only has access to the environment variables that were loaded when the command was first ran.
I assume that the node
process loads .env
, then starts the actual application as a child process with the same --env-file
flag. This should cause the child process to load the environment file upon start, however, the child process inherits the environment variables from the parent process, and inherited environment variables take precedence over variables read from .env
, so you wouldn't see any changes to existing environment variables.
To test this hypothesis, could you check if you can see new variables in the child process when you add a new entry to .env
while --watch
is running?
from node.
To test this hypothesis, could you check if you can see new variables in the child process when you add a new entry to
.env
while--watch
is running?
I just tested this and I can! You're right.
from node.
Related Issues (20)
- `pathToFileURL` function in url fails to handle `\\?\UNC\` Prefix properly HOT 3
- Unactionable "Label ... already exists for `debuglog.time`" warning since Node.js 22.6 HOT 6
- Error [ERR_INTERNAL_ASSERTION] HOT 2
- `nodejs.util.inspect.custom` support for uncaught Errors HOT 1
- Increased memory usage in nodejs version 20.16.0 due to fetch() HOT 9
- JavaScript error occurred in the main process HOT 4
- `private constructor` is not supported in nodejs 22.6.0 HOT 8
- [BUG] Installing an update of Node removes any custom permissions of the folder (Windows) and locks the ability to update npm/corepack HOT 1
- fs.cpSync fails when copying to a directory with a name starting with the source directory name HOT 2
- Network request fails after event loop is blocked for a few seconds (regression in v20) HOT 4
- Indicate typescript support in `process.features` HOT 5
- Buffer() deprecation check throws TypeError: Cannot read properties of null (reading '0') inside new Promise() HOT 2
- App
- Support types in vm.compileFunction HOT 1
- App
- NVM LINK
- NVM LINK
- Node does not determine that a file is an ES module when the package.json is in a long path HOT 3
- All comunity HOT 1
- sqlite async API HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from node.