-
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
New files in empty folder not watched #166
Comments
This issue should be fixed in |
Hey @shama, I just tried that and it's still doing the same unfortunately, it did show that gaze is Is there anything else I could try, or anything that could help find the issue? Cheers! |
Hmm which version of node.js and which os? |
I'm running:
|
Same here. As far as I can see at least one file following the pattern in
I already updated to latest |
I can confirm what @luissquall describes is exact behavior I'm seeing. |
Just wondering if anyone's had chance to have a look at this? Would be awesome to automatically watch new files in empty folders. @shama — If theres anything I can do to that could help find the issue just let me know. |
+1, I can confirm the same behavior as described by @luissquall
|
Thanks everyone! I'll take a look when I get a chance. I have tests for this in gaze so I'm not sure why it isn't working here. We should add a test case for it here and work backwards to figure out why. |
Update: the |
Any progress made on this one? I'm having the same issue on osx 10.8.4. |
I looked into it briefly, no real progress yet. Will look into more soon. |
@shama — If you need anything testing to help fix it I can try help out. |
In gaze.js, how about replacing:
with
? minimatch.match doesn't seem to be able to handle relative paths. I can submit this as a pull request if it makes sense. |
I tried the above code change against the gaze project's tests. The following tests failed: watchTest.js::addedEmitInSubFolders() ideas? Environment: |
How I usually go about these things is to write a new test case that matches the desired behavior. Then adjust the code until the new test passes along with the existing tests. This way we're sure we're working towards the fix we want without breaking any previous fixes made. |
I can jive with that. In the meantime, would you have any idea why those 2 particular test cases would be failing with the above code change? |
Okay, I figured out what's causing my issue. I was doing the following:
i.e. I was using an absolute path instead of a relative path. The above invocation would result in newly created files in /gazetestfolder not registered. If I use a relative path: Is this the intended behavior of gaze? NB: my case is different than the case that @markgoodyear reported. I tried out his case (making a new directory then adding a file to it) and I do observe the same behavior that he has observed (new files added to that directory are not registered). Maybe I should open up a separate issue for the absolute path stuff? |
Yes. There is an open issue for that here: shama/gaze#41 But it is low priority for me though as you can set the |
@markgoodyear @luissquall @mnoble01 Out of curiosity, are you using absolute paths as well? |
Hey @shama, I've not had chance to test the above, however I do use relative paths in my Gruntfile, if that's what you're meaning? I'll be able to check what @brett-shwom suggested later today (#166 (comment)). Cheers |
@markgoodyear, I don't think that my suggestion will work for you. When I added that suggestion, I was under the impression that you and I were having the same issue. It turns out that I conflated our issues: I was using absolute paths and so no file creation events were getting triggered, whereas your issue was that file creation events weren't getting triggered when files were created in a folder that was created after the grunt watch task was kicked off. The code change I suggested only seems to add support file creation events that do not occur in new folders when an absolute path is specified in |
@shama, I'm also using relative paths in my Gruntfile... |
+1 I'm also running into this issue with new files not being detected (although I hadn't linked it to empty directories) |
+1 .. same issue with latest libraries |
@pkieltyka what issue are you having? |
@brett-shwom I'm still having the same issue as my original post. New files in empty folders do not get picked up when using |
Just out of curiosity, is anyone closer to finding a solution for this issue? I'm having the same trouble here, but the project I'm working on at the moment specifically needs to watch for files inside folders that are created and deleted dynamically by other processes.. I've tried with using both relative and absolute paths, with and without the Regardless of my Gruntfile setup, I always see the following behaviour:
Note: folder depth doesn't seem to make any difference in my case. My system is as follows: To be fair, I don't necessarily need to use Grunt for this project, I just thought it would make life easier. I see Gaze itself has had quite a few changes since the version used by grunt-contrib-watch, so perhaps I'll try with that directly and see how it goes. |
@ZaLiTHkA Any luck with the new Gaze? I'm seeing the same issues as you (on the same platform). Thanks! |
I see this on non-empty folders, when adding new files. On 10.9.4 running grunt to watch NFS volume mounted to Vagrant through a docker container. The project grunt-simple-watch is the closest i've found, but it can't do casacading/chain detection and lacks livereload. |
Have the same problem as ZaLiTHkA and others OS: Win 8.1 |
Not sure if this needs a new issue or not but, I was able to reproduce this behaviour whilst using Vagrant with folder sharing, and Docker with volume sharing. It's able to detect changed files, but not new files. |
@foxx I confirm this behavior. |
@foxx Any fix for this behavior? I have same issue on Vagrant with NFS sharing. |
@XhmikosR Yeah, I stopped using grunt :( |
@foxx same issues. Which one are u using? |
More than 2 years later, this problem still exists? I can't get any new files to be picked up whatsoever. Only existing files are picked up, no new files regardless as to whether the directory is empty or already contains files. cwd changes nothing, and there is no difference between /**/ in files or separate listings. OS: Ubuntu 14.04 VirtualBox guest, Windows 7 host 2+ years for one bug report makes me sad. Our team wanted to use SASS for our new project, but this single problem completely removes that possibility. |
@frickenate Not picking up any new files is different than this issue. This issue is specifically about files added to empty directories and/or new directories being created. You could check #282 for possible solutions to your problem, as it's more generic. In general, prefixing paths with "./" and using absolute paths are issues that can make the watcher not pick up new files, so if you want to watch all |
Just ran into this issue as well, it's ridiculous that this is still open after 2.5 years. |
Yeah, seems like it will be never fixed ever... |
I've found a dirty walk-through in gulp (3.9.1) but it should work in grunt since both use gaze. In empty folder there's no registered pollers and that's the reason why watcher doesn't trigger. We must make a ghost poller, basically a 'unnamed extension' like .sass and enable globs to accept dots. Windows 10run -> cmd.exe In gulp add dot option to In grunt it probably will look like this:
Pros: |
What the flying f*? This issue is so old and not fixed, seriously? Sure I can restart grunt when changing folder structure, so technically the workaround isn't a major issue per say, but it is kind of a fundamental feature to have. Come on, pull yourself together, will you? |
I believe switching to chokidar will fix issue, but as far as I know switching isn't that easy. |
@rohdef This is open source. Nobody is making money and this is all volunteer effort. If this issue means so much to you, contribute something that will fix it, or fork and publish a forked version. Other forked solutions I've found: |
So sad that this has not been prioritized enough to fix. So many new developers to your tool will hit this hangup. |
I wonder would maintainers fix it if we crowdfund for it? |
Just drop it, grunt and gulp are unnecessary these days since npm gives you much more power (http://goo.gl/rcqrfV) |
@idbartosz Once you start dealing with something more complex you will realize that npm is missing plenty of things and managing run scripts will become a nightmare |
Not to mention some things are still really difficult with npm if you must use Windows as your operating system. Command line args being one of them. Feel free to fix that and then you have a valid argument. |
Everything got it pros and cons guys, but I get your point - let's go back to topic :-) |
wow. how could this still be an issue when it unpredictably fails to perform such a fundamentally necessary function? i guess i'm going to abandon grunt-contrib-watch and try something that actually-works.jpg https://github.com/JimmyRobz/grunt-chokidar works just fine as expected. why wouldn't you merge their changes into your project and clear this right up? |
Hi,
I'm trying to set up watching Sass files and compiling them. Everything works great appart from when creating a new empty directory (or using an existing one which empty), then adding in a new file. Using
grunt watch --verbose
shows that the folder gets added, but any new files inside aren't recognised. If the folder already has a file inside, new files are recognised.Is this a known issue?
A stripped down version of my Gruntfile.js for the two tasks involved is:
EDIT
Just thought I should mention I'm running version 0.5.1.
The text was updated successfully, but these errors were encountered: