grunt-contrib-watch icon indicating copy to clipboard operation
grunt-contrib-watch copied to clipboard

Infinite loop when watch target does not exist

Open ragulka opened this issue 9 years ago • 3 comments

It seems that if I provide a specific target and that target does not exist in grunt config, then watch goes into an infinite loop:

Running "watch:joke" (watch) task
Waiting...Verifying property watch.joke.files exists in config...ERROR
>> Unable to process task.
Warning: Required config property "watch.joke.files" missing.

Running "watch:joke" (watch) task
Waiting...Verifying property watch.joke.files exists in config...ERROR
>> Unable to process task.
Warning: Required config property "watch.joke.files" missing.

Running "watch:joke" (watch) task
Waiting...Verifying property watch.joke.files exists in config...ERROR
>> Unable to process task.
Warning: Required config property "watch.joke.files" missing.

This does not seem to stop unless I kill the terminal tab. Sometimes Ctrl+C helps, sometimes not. In any case, I believe watch should simply exit once it encounters an error instead of keeping trying.

ragulka avatar Jan 20 '15 07:01 ragulka

Yeah this one is pretty annoying when switching back-and-forth between branches :confused:

restlessdesign avatar May 15 '15 03:05 restlessdesign

Yeah, for me (and another friend too), this not only loops and freezes the pain, it causes all of my applications to stop responding so I have to force restart the computer completely. I can't believe this hasn't gotten any attention at all in two years. This shouldn't be a difficult fix right? Just check if (!grunt.config.get('watch.' + this.target)) // return or log or call fail.fatal right? (Off the top of my head . . . can't recall if that's exactly what you'd need.)

tandrewnichols avatar Dec 08 '16 18:12 tandrewnichols

2015 issue still annoying people in 2017 :-\ . i'm having the same issue... gruntwactherror

ecso avatar Jun 30 '17 14:06 ecso