--watch restarts only once
未关闭
还没有人认领这个 Issue。
libuv
stale
watch-mode
- 主要语言
- JavaScript
- 星标
- 122k
- 派生
- 37.4k
- 平均合并
- 4 天 3 小时
- 30 天内合并 PR
- 272
描述
Version
v20.15.1
Platform
Linux derby 6.6.46-0-lts #1-Alpine SMP PREEMPT_DYNAMIC 2024-08-16 08:05:54 x86_64 Linux
Subsystem
No response
What steps will reproduce the bug?
f.js contains only console.log('hello')
node --watch f.js
hello
Completed running 'f.js'
Change f.js to console.log('hello world')
Restarting 'f.js'
hello world
Completed running 'f.js'
Change f.js again, e.g. console.log('this change will not restart watcher')
No change in the watch output.
(I'm changing the file outside of the debounce/throttle period)
How often does it reproduce? Is there a required condition?
It happens every time.
What is the expected behavior? Why is that the expected behavior?
I would expect that --watch would restart after every write to f.js, not just after the first change made to the file.
What do you see instead?
--watch only seems to restart after making the first change to the file.
Additional information
Also seeing this problem on Termux for Android node v22.5.1
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
调研方向
首先使用 node --watch f.js 重现该问题,在 debounce/throttle 周期之外多次修改文件。跟踪 --watch 入口点及其重启处理;完成的标准是每次后续写入 f.js 都会重启进程,并且已在报告所述的环境中验证该行为。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- javascript, nodejs
- 领域
- cli
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 活跃
- 描述清晰度
- 描述清楚
- 新手友好度
- 64/100