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

File watcher has problems #651

Closed
contra opened this Issue Sep 1, 2014 · 28 comments

Comments

Projects
None yet
@contra
Member

contra commented Sep 1, 2014

I'm merging all file watching related issues into one issue, since there is one solution. The next version of gaze is under development and we are waiting for it to come out before we can fix the following issues:

  • high cpu usage
  • doesnt catch new files
  • globs get matched even though it was a file change that shouldn't match it
  • new files arent watched
  • stops on error (unrelated to gaze, but fixed already in gulp 4)

Please do not open any new issues regarding these problems. The current rate is 3-5 a day, they will be closed for duplication.

@shama is working on fixing these issues in gaze, if you have any new file watching issues you didn't see in the list please open them at https://github.com/shama/gaze

@darsain

This comment has been minimized.

Contributor

darsain commented Jan 20, 2015

Perhaps a lot of current issues would be fixed by updating to newest gaze? Because you are quite behind. Current gulp (3 & 4) install resolves to 0.5.1, but gaze is on 0.6.4 already.

Specifically the gulp.watch throws error on removing folder which is what I'm running into right now seems to be already fixed in shama/gaze#44.

@shama

This comment has been minimized.

shama commented Jan 20, 2015

@contra

This comment has been minimized.

Member

contra commented Jan 21, 2015

@darsain The new gaze is more broken than the old one

@TrySound

This comment has been minimized.

Contributor

TrySound commented Jan 21, 2015

Maybe replace gaze with chokidar?
I think it's more powerful and flexible.
And guys work faster.

@contra

This comment has been minimized.

Member

contra commented Jan 21, 2015

@TrySound They need to finish the work on glob support before it becomes feasible, but it is something we will look into when chokidar is ready

@TrySound

This comment has been minimized.

Contributor

TrySound commented Jan 21, 2015

Good:)

@shama

This comment has been minimized.

shama commented Jan 21, 2015

homer-simpson-bush-gif

@TrySound

This comment has been minimized.

Contributor

TrySound commented Jan 22, 2015

@contra 1.0.0-rc2 was released

@es128

This comment has been minimized.

Contributor

es128 commented Jan 22, 2015

lol @shama, great gif, haven't seen that one before

I did offer to join forces when I was first asked to take the reins on chokidar 😄: paulmillr/chokidar#138 (comment)

but c'mon, you know you still deserve credit for the great work done on gaze

@es128

This comment has been minimized.

Contributor

es128 commented Jan 22, 2015

@shama

This comment has been minimized.

shama commented Jan 22, 2015

@es128 No worries. More options is always better than being stuck with one. If chokidar works better than gaze for you then you should use it. Many libs I use have chokidar as a dep, so I'm grateful for the work you've put into it. :)

Anyways, if anyone needs me, I'll be in my bush.

@mattfelten

This comment has been minimized.

mattfelten commented Jun 3, 2015

Any update on this? Just ran into the error when deleting a folder yesterday.

@fabpopa

This comment has been minimized.

fabpopa commented Jun 11, 2015

Just as a note, while this issue is open, some alternatives are @floatdrop's gulp-watch or Browsersync.watch(), both of which are wrappers for chokidar. I'm using the Browsersync method and add/change/delete/rename/delete-directory events work very well with paths as well as globs.

@igoradamenko

This comment has been minimized.

igoradamenko commented Jun 17, 2015

@fabpopa So chokidar has some bugs too paulmillr/chokidar#292

@PyroSA

This comment has been minimized.

PyroSA commented Aug 17, 2015

It'll be summer soon in the summer Hemisphere, and this is causing my CPU to act as a heater.
(Windows Environment).

It occasionally does a back-flip and lands on it's head when changing branches as well.

@contra

This comment has been minimized.

Member

contra commented Aug 18, 2015

Status update: going to start working on switching to chokidar now that it has stabilized

@phated

This comment has been minimized.

Member

phated commented Sep 30, 2015

Now that chokidar has been merged into the 4.0 branch. Can we close this?

@contra contra closed this Sep 30, 2015

@PyroSA

This comment has been minimized.

PyroSA commented Oct 1, 2015

Got me all excited, until I realised 4.0 isn't available for our project yet.

@AnthumChris

This comment has been minimized.

AnthumChris commented Nov 30, 2015

@mattfelten: I'm catching the errors caused by file renaming and silently ignoring them

gulp.task('watch', ['build'], function(cb) {
  gulp.watch('src/**/*.js', { interval: 200 }, ['build'])
    .on('error', function(error) {
      // silently catch 'ENOENT' error typically caused by renaming watched folders
      if (error.code === 'ENOENT') {
        return;
      }
    })
})
$ node --version
v4.2.2

$ gulp --version
[11:54:01] CLI version 1.0.0
[11:54:01] Local version 3.9.0

tbck added a commit to aptuitiv/cacao-cracker that referenced this issue Feb 16, 2016

Remove gulp-watch in favor of built in gulp.watch
gulp-watch used to be necessary to pick up on new and deleted files. Gulp has recently been updated to fix this.

gulpjs/gulp#651
@leonardothibes

This comment has been minimized.

leonardothibes commented Feb 19, 2016

Hello guys.

I found a cause of this problem: many files opened in same time are blocked by S.O.

In Ubuntu/Linux, for example, you can increase this limit editing a file /etc/security/limits.conf(you must reboot your Linux after edit this file to apply the changes) and putting this content below in the end of file:

soft nofile 4096
hard nofile 4096

4096 it's a limit of files with the S.O can open in the same time, you can choice other number for you needs.

This is a S.O. problem, not a gulp problem.

Regards.

@AlexLeung

This comment has been minimized.

AlexLeung commented Apr 19, 2016

When I delete a folder that is matched by the glob I send to gulp.watch,
I still get

events.js:154
      throw er; // Unhandled 'error' event
      ^

Error: watch null EPERM
    at exports._errnoException (util.js:890:11)
    at FSEvent.FSWatcher._handle.onchange (fs.js:1296:21)

@spiritix

This comment has been minimized.

spiritix commented May 3, 2016

So when will the next version of gaze be released? Anyone knows anything?
Can't really use gulp watch like this, very annoying.

@phated

This comment has been minimized.

Member

phated commented May 3, 2016

@spiritix their 1.0 was released but it was a reversion to the code we use from the 0.5 branch so it will never be fixed in gulp 3.x. Upgrade to gulp 4, switch to chokidar or something else.

I'm locking this thread.

@gulpjs gulpjs locked and limited conversation to collaborators May 3, 2016

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.