Skip to content
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

watch task always stopping: No possibility to make it retry after some seconds? #1693

Open
Blackbam opened this issue Sep 25, 2019 · 0 comments
Labels

Comments

@Blackbam
Copy link

Blackbam commented Sep 25, 2019

This is especially a problem because it happens when I am typing in the IDE. The issue was also asked on SO but no answers till now: https://stackoverflow.com/questions/57992153/grunt-watch-always-stops-watching-after-fatal-errors-how-to-make-it-retry-af

Within some project I use Grunt for tasks like SASS compilation and so on. Basically it works like a charm, but as long as I am typing within the SASS files obviously sometimes an error occurs as I am not finished.

The watch task of my Gruntfile is like this:

// watch files
watch: {
    sass: {
        files: ['web/var/static/**/*.scss','web/var/static/lib/**','web/var/static/js/*.js'],
        tasks: ['default']
    }
},

I start it with grunt watch in the cli.

Sample error in Grunt log:

Completed in 1.968s at Wed Sep 18 2019 13:43:01 GMT+0200 (Central European Summer Time) - Waiting...
>> File "web/var/static/sass/layout/footer.scss" changed.
Running "sass:dist" (sass) task

Running "autoprefixer:dist" (autoprefixer) task
>> 4 autoprefixed stylesheets created.

Running "cssmin:dist" (cssmin) task
>> 4 files created. 706.54 kB → 598.46 kB

Running "concat:dist" (concat) task

Running "uglify:main" (uglify) task

Done.
Completed in 1.769s at Wed Sep 18 2019 13:43:25 GMT+0200 (Central European Summer Time) - Waiting...
>> File "web/var/static/sass/layout/footer.scss" changed.
Running "sass:dist" (sass) task
Fatal error: Error: property "ul" must be followed by a ':'
        on line 52 of web/var/static/sass/layout/footer.scss
        from line 13 of web/var/static/sass/main.scss
>>     ul

   ----^

I always have to re-run the task if this happens because grunt stops watching. That means:

  • open the console window
  • stop the current task
  • start the task again
  • change a file

This is really slowing down.

Has anybody had a similar problem? How to make grunt retry automatically after an error as soon as a new file changes happens?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants