You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
--watch-path also watches --env file directory tree in >=22.7 #55913
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.
changed the title [-]`--watch-path` broken starting with version 22.7[/-][+]`--watch-path` also watches `--env` file directory tree in >=22.7[/+]on Nov 21, 2024
It seems that the pull request #54109 that was merged into 22.7 introduced this issue, i.e. instead of watching just the env file it watches the directory tree where the env file is located. @marekpiechut any ideas how it could be fixed?
This issue has been marked as stale due to 210 days of inactivity.
It will be automatically closed in 30 days if no further activity occurs. If this is still relevant, please leave a comment or update it to keep it open.
This issue has been automatically closed after 30 days of inactivity following its stale status (no activity for a total of 240 days).
If this is still relevant, feel free to reopen it or leave a comment with additional details so we can continue the discussion.
Activity
targos commentedon Nov 19, 2024
I'm not able to reproduce.
gorankarlic commentedon Nov 20, 2024
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:
--envargument must be present--watch-pathargument must be presentIn this case Node 22.7 and above erroneously starts watching the directory tree where the environment file (in this case
dev.env) is located. That means that executingtouch sub/test.txttriggers a restart.Please find attached a complete example 55913.zip that can be used with the above description to reliably reproduce the issue.
pmarchini commentedon Nov 20, 2024
Hey @gorankarlic, could you please provide the repro as a public repository? 😊
gorankarlic commentedon Nov 21, 2024
Please find the public repository with the reproducible at https://github.com/gorankarlic/55913.
pmarchini commentedon Nov 21, 2024
Thanks @gorankarlic 😊
[-]`--watch-path` broken starting with version 22.7[/-][+]`--watch-path` also watches `--env` file directory tree in >=22.7[/+]gorankarlic commentedon Nov 26, 2024
It seems that the pull request #54109 that was merged into 22.7 introduced this issue, i.e. instead of watching just the
envfile it watches the directory tree where theenvfile is located. @marekpiechut any ideas how it could be fixed?Add test for nodejs#55913
Switch to nodemon for dev script
github-actions commentedon Apr 26, 2026
This issue has been marked as stale due to 210 days of inactivity.
It will be automatically closed in 30 days if no further activity occurs. If this is still relevant, please leave a comment or update it to keep it open.
github-actions commentedon May 26, 2026
This issue has been automatically closed after 30 days of inactivity following its stale status (no activity for a total of 240 days).
If this is still relevant, feel free to reopen it or leave a comment with additional details so we can continue the discussion.