Open gorankarlic opened 3 days ago
I'm not able to reproduce.
I have discovered that the issue is a bit more convoluted and indeed can not be reproduced as stated above.
In order to reproduce the issue two conditions must be met:
--env
argument must be present--watch-path
argument must be present
--watch-preserve-output
is used here only for easier observation but is not required to reproduce the issue
node --env-file sub/dev.env --watch-path /usr/local/bin --watch-preserve-output index.js
In this case Node 22.7 and above erroneously starts watching the directory tree where the environment file (in this casedev.env
) is located. That means that executing touch sub/test.txt
triggers a restart.
Please find attached a complete example 55913.zip that can be used with the above description to reliably reproduce the issue.
Hey @gorankarlic, could you please provide the repro as a public repository? 😊
Hey @gorankarlic, could you please provide the repro as a public repository? 😊
Please find the public repository with the reproducible at https://github.com/gorankarlic/55913.
Hey @gorankarlic, could you please provide the repro as a public repository? 😊
Please find the public repository with the reproducible at https://github.com/gorankarlic/55913.
Thanks @gorankarlic 😊
Version
22.7.0
Platform
Subsystem
No response
What steps will reproduce the bug?
When running
node --watch-path lib test.js
with 22.6.0 it behaves as expected (restarts only when a file changes in thelib
directory).When running
node --watch-path lib test.js
with 22.7.0 it keeps restarting indefinitely.How often does it reproduce? Is there a required condition?
Always reproducible.
What is the expected behavior? Why is that the expected behavior?
Should only restart when a file changes in the watched directory.
What do you see instead?
Restarting indefinitely in a loop.
Additional information
No response