Closed
Description
Version
v20.5.0
Platform
No response
Subsystem
No response
What steps will reproduce the bug?
- create an empty file called
watchthis.js
- create another file called
runthis.js
with the following content:
const { writeFileSync } = require("fs")
writeFileSync("./watchthis.js", "console.log('foo')")
setTimeout(() => {
writeFileSync("./watchthis.js", "console.log('bar')")
}, 100)
- run
node --watch ./watchthis.js
in a terminal - run
node runthis.js
in another terminal
How often does it reproduce? Is there a required condition?
Every time
What is the expected behavior? Why is that the expected behavior?
The last printed value in the first terminal should be "bar".
What do you see instead?
The last printed value is "foo".
Additional information
No response