-
Notifications
You must be signed in to change notification settings - Fork 357
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
Stops reacting to file changes after the first time #13
Comments
Your config looks good. Can you update to the latest node v0.8.14? v0.8.8/9 has a watch issue: nodejs/node-v0.x-archive#3997 Otherwise set the option |
I'm having the same problem even after updating to node 0.8.14. Any thoughts? BTW. I'm using |
For me forceWatchMethod: 'old' work only |
Hopefully I can help you guys get it working. I'm having some trouble duplicating the issue on node v0.8.14 on OSX 10.6, Windows 7 and Ubuntu 12.04.
@aoberoi and @Darrrk Which OS and version are you using? So I can try to duplicate to see if I can find the issue. Thanks! |
@shama thanks for responding so promptly :) I'm using OS X 10.8.2. Do you think it would help if I download the node source and run the test suite? It looks like theres one for watch at https://github.com/joyent/node/blob/master/test/simple/test-fs-watch.js |
Thanks @aoberoi I think that would be very helpful. I hope it's not an issue with OSX 10.7+ as I only have access to a OSX 10.6 machine atm. I'll bother some co-workers this week to see about testing on OSX 10.8 or 10.7 as well. |
This might be related: nodejs/node-v0.x-archive#3343 |
The test suite for v0.8.14 passes on my machine. From the issue you refereced, it looks like we shouldn't hope for a fix until version > 0.9 is stable? That would stink. |
+1 I'm on node v0.8.15 / OSX 10.8.2 and experiencing the same thing. Only works when using |
This issue is dependent on the editor being used to cause the change. For example if I edit a watched file with vim or Intellij it will work the fist time but not for any changes after that. If I use sublime it will work fine for each change (node v0.8.15 OSX 10.8.2). The difference between the editors appears to be vim and intellij will renames the original file unlike sublime which which just changes the file. You can see this in the the events being fired from the fs.watch. I don't know the details of the editor implementations, but I assume vim and intellij renames the original file being watched and all future edits are happening in a new file that isn't being watched. EDIT: |
I'm using MacVim, @rgaskill description sounds like the right idea to me. Perhaps we should add "vim" mode where it watches for files being moved around? |
I'm using Coda 2 with the same symptoms as @rgaskill |
You can add Quite annoying because technically the watch is doing what it is supposed to. When the editor deletes the file, it stops watching it. Adding a |
I have a rough hack at 214c326f54. It will handle the rename caused by editing, but I don't think it will handle an actual rename correctly. |
Here is a test to simulate a safe write event: shama/gaze@8f6c61e |
@shama I have a fix here rgaskill/gaze@d021f4f9 that will pass your test. I also fixed what appeared to be a bug in the _isMatch method and _initWatched method rgaskill/gaze@95d42e5. There still appears to be some leaking file handles though. When I run all the tests together I get:
I get this error in the master branch as well. I will continue to look into the "too many open files" issue, but I thought you might want to comment on what I have done so far. |
@rgaskill Nice! I'll give that a go. Want to open a PR?
|
Sure no problem. PR shama/gaze#6 |
Running node 0.8.15 on Ubuntu 12.10, also getting this very annoying issue. It actually happened to me while working on another lib of mine, remote. I fixed it by using this:
Which is probably the same code being used when using My opinion is: while the node API isnt stable, simply use a smaller polling value. 1000 is ok. The default 5000 is sluggish. |
@gadr90 Yep that is the same as |
Oh, cool. Strangely feels slower, though. On Tue, Dec 11, 2012 at 10:51 PM, Kyle Robinson Young <
|
@gadr90 Looks like I was wrong. It was supposed to be 100ms but @rgaskill identified a bug where it was actually 5000. Fixes coming down the pipeline from shama/gaze#9 soon. |
Fixed with 808d4a3 and available in v0.2.0a. |
i'm on OSX 10.7.4 with node 0.8.8 using watch v0.1.4 and here's my grunt file
i run
grunt watch
and it works the first time i save the file and then no more... am i doing something wrong?The text was updated successfully, but these errors were encountered: