-
-
Notifications
You must be signed in to change notification settings - Fork 584
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Change event is only triggered twice when watching one file #556
Comments
Cannot reproduce on Windows 7.1, Node 6.9.1, Chokidar 1.6.1 |
I do not try on windows. but it happens on Ubuntu |
Also cannot reproduce on Arch, Node 7.1.0, Chokidar 1.6.1. Have you tried logging the raw events to see if chokidar is actually told of a change event? (and are you actually sure you're changing the file) |
I have been hitting this error as of lately, I'm on v1.6.1 as well |
My issue turned out to be an EMFILE one |
Experiencing that here. |
I want to watch file and only handle change event, but it is only triggered twice, when I change the watched file with third time, it can not handle change event, my code is here:
var chokidar = require('chokidar');
var path = require('path')
function registerFileChangeListener()
{
let testfile= path.join(__dirname, '../test.txt')
let watcher = chokidar.watch(testfile)
watcher.on('change',(path,stats)=>
{
console.log(path +' is changed')
})
}
registerFileChangeListener()
But it can fix this issue by adding
{
usePolling:true
}
I am not sure why this happen.
The text was updated successfully, but these errors were encountered: