-
Notifications
You must be signed in to change notification settings - Fork 356
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
Not detecting newly added files #282
Comments
Strange, I don't think it's because of the hyphens. I work with file names with hyphens in them on a daily basis without any issues. What node.js version? What OS and version? What are the actual file names? Are you sure they are matching? Try |
Hi @shama , thanks for the quick reply, I've checked and you're perfectly right: in fact the problem is not related to file names, but inability to detect newly added files (sorry for the confusion). I've just updated the original issue here above with all details. Do you have any advice on how to get the problem fixed? Thanks! :) |
What is the path of Also, just a personal request, in the future would you mind adding a new comment or opening a new issue instead of editing your existing one? Just to avoid confusion with someone else coming across the same issue reading the thread. Thanks! |
Hi @shama, sure no worries I'll make sure to open new issues in the future :) In this case, after I understood the problem better I just realized the original issue was useless, and that's why I modified it. Regarding your question, for this specific project where I have the problem, the path of
Any thoughts? Thanks :) |
Hmm that could be it. The cwd is always implied so a |
I see, thanks for pointing that out! Removing the On the other hand, as a general approach I actually liked having a variable defined once in the So, I still think it would be cool to be able to use Cheers! |
Yep, it's fixed the next version of gaze. :) Which will land here as soon I as get safe writes solid for linux (last failing test on that branch). |
A-w-e-s-o-m-e!! Thanks a lot, great job ;) |
Still experiencing that issue with no "." in my cwd; weird |
Had this problem and removing |
+1 |
Same than @JSteunou |
Is this plugin supported, yet? |
I found bug in my Gruntfile. Don't use './' before file path. Watcher doesn't work on file add, with this. |
Remove of './' works for new files of non-empty folders, but I have an issue when adding a files in a new empty folder. |
+1 I'm having the same issue on empty folders and newly created folders. |
Same problem here, nfi why |
The same problem is here. Adding new folder and then adding new file into does not detected by watch task (OS: Windows 7 x64). |
Recked on OS X 10.9.5. Works fine. |
I can confirm that "adding a new folder and then adding a new file into it is not detected by the watch task (OS: Windows 7 x64)". In my case, I'm adding the folder from a symbolic link, which may or may not explain the issue. |
In case it might help someone else, I had the same problem (OS: Windows 8.1 x64) until I set: options: {
event: ['changed', 'added', 'deleted']
} After I set that under options it appears to fix my issue of not detecting new files / folders. Not sure why the default of |
I experienced the same problem when I had "./" at the beginning of the search path. I removed it and it now it does detect newly added files in non-empty directories. I can confirm that it still doesn't detect new files in an empty directory. Applying @denney's suggestion didn't seem to help. I also tried setting the (node As this issue has been unresolved for more than a year now (and more than year and a half for related ones such as #166 and shama/gaze#177 and shama/gaze#167). Being the most popular (and one of the most useful) grunt plugins I find it strange no solution has been found yet and considering either fixing it myself or looking for an alternative plugin. Edit: After further searching I've found this pull request for a related test: shama/gaze#103 . It seems there is an alternative to gaze called https://github.com/shama/navelgazer that's in development and may not have this problem. It may eventually be used in grunt-watch. I will look further into it. |
👍 |
https://github.com/unbalanced/grunt-simple-watch |
I think this may be related to Vagrant shared folders (due to lack of inotify?) |
FWIW, this task also does not work for added (or deleted, I think) files if the file paths are absolute. |
https://github.com/unbalanced/grunt-simple-watch |
@UnknownHero It's works for me, this issue waste me 2 days, OMG. |
Having the same issue where newly created less files aren't watched. I've managed to reproduce this with a minimal example module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-contrib-watch');
var config = {
watch: {
less: {
files: ['src/**/*.less'],
tasks: ['listfiles:less']
},
js: {
files: ['src/**/*.js'],
tasks: ['listfiles:js']
}
},
listfiles: {
js: {
src: ['src/**/*.js']
},
less: {
src: ['src/**/*.less']
}
}
};
grunt.initConfig(config);
grunt.registerMultiTask('listfiles', 'List files matched', function () {
console.log(this.filesSrc);
});
}; Now if we create a
What seems to be happening is that the absence of at least one matching file in the directory prevents Hope this can help bring about a solution. |
+1 |
4 similar comments
+1 |
+1 |
+1 |
👍 |
More than 2 years and still no solution or explanation for this issue? |
Nope, still having this problem. I will try to debug myself tomorrow. It is a really annoying bug. |
It seems that there is only a problem with new files, if the watcher is configured to look at specific file types. I now use |
@foxx in my case with vagrant and nfs it is really the problem with lack of inotify. https://github.com/unbalanced/grunt-simple-watch solves it through polling but it uses 20%-25% cpu of the guest machine instead of 5% with normal watch. |
grunt-simple-watch lacks livereload support :( |
@seomantix I tried to remove the file extension and the "*" but it still doesn't work. Perhaps when you tested it you had an old file where you didn't expect? |
- see thread: gruntjs/grunt-contrib-watch#282 - implemented suggestion by user seomantix - update to read me
Still happening. OSX |
still have this issue, win10.
i think something bad happens after new folder is created. ) |
The issue also exists in this case (Windows_NT x64 10.0.14393):
|
I can confirm that the bug still exists with 1.1.0. Update: It seems that gaze is the cause: shama/gaze#177 |
grunt-cli v1.3.2 |
If I understand correctly,
grunt-contrib-watch
should detect any added, modified, or deleted file that matches the patters specified in the Grunt configuration file.On the other hand, I noticed that in my case it doesn't detect newly added files at all.
Here's an example of my Grunt configuration:
grunt-contrib-watch
perfectly detects modifications to existing files, but for example if I add a new.styl
file in the specified folder nothing happens. I'm using Node 0.10.24 on OSX Mavericks.Any advice on what might be causing the problem?
Thanks :)
The text was updated successfully, but these errors were encountered: