-
-
Notifications
You must be signed in to change notification settings - Fork 586
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 with usePolling: true not completing task? #282
Comments
here is the watchify line that sets the relevant options for chokidar based on that |
So it looks like you're using two separate components that use chokidar (watchify and gulp-watch) with different watch-mode settings for each chokidar instance. This is not well-explored territory, and it's not very easy to reason about what's going on because of the layers between your implementation and chokidar. Can you share a repo I can use to try to reproduce the issue locally? |
@es128 For what it's worth, the gulp-watch that I'm using is an old version that is still using Gaze@0.5.x, which is just an I can put together an example repo shortly. Thanks! |
Your whole problem is with the jshint task not running, and it is using a gaze-based watcher. The way you described it, your watchify task is stable and consistently runs with either setting. So I am now confused about why you think chokidar is the culprit.
I am not in the business of advising on gulp configurations. All I can say is that nobody has yet presented an issue involving one polling and one non-polling chokidar watcher within the same process - although as it turns out that was not the case here. Have you tried/considered updating your gulp-watch? |
I was just about to post an update to say that the same thing happens with gulp-watch 4.2.4 (set to use polling, as well, but with chokidar). The reason I believe it's chokidar (or watchify, actually) is the culprit, is because the linter (or any other task for js-files) run as expected without running watchify or while running watchify with chokidar using fsevents. That is to say, I can repeatedly save a file and it gets linted every time. However, as soon as watchify rebuilds once (with |
I understand your point about how you've narrowed down the difference that causes the issue, but I don't see how there's anything chokidar could be doing to disrupt the rest of your tasks. Perhaps file an issue with watchify if you haven't already. Closing for now, but will reopen if an issue with chokidar can be demonstrated or at least described more directly. |
Okay, thanks @es128. For posterity, I should add that if I update |
Yeah everything that you've described that's directly chokidar related seems to work. The only thing that breaks is the handoff from watchify back into the rest of your gulp pipeline when using a watchify-specific option. I understand the intent of the option is just to manipulate chokidar's options, but nonetheless it is not a simple pass-through, and I have no idea how else watchify's behavior is changed because of it. |
Hi, I have a strange issue--I've resorted to setting
useFsEvents = false
because of #219 , except when I do that, my other watched callbacks only execute once. Here's an example:If I run
gulp watchify jshint
and then savemyGreatModule.js
, watchify will pick up on the change, and jshint will run. If I savemyGreatModule.js
again, only watchify will run--jshint will not. If I remove thepoll: 750
line, both watchify and jshint run on every save. Can you explain why and what I can do to fix it? Does watchify need to emit an 'end' event or something to let gulp know that the rebundle method has completed?The text was updated successfully, but these errors were encountered: