grunt-contrib-watch: FSEventStreamStart: register_with_server: ERROR: f2d_register_rpc()

I have an issue where on every 3rd save I get this: ERROR

It appears when I either save it 3 times within the same file or if I open up 3 different files, the error will appear afte the 3rd file has been saved.

Here’s my code:

/*global module:false*/

var minimatch = require('minimatch');

module.exports = function (grunt) {

  grunt.initConfig({

    watch: {
      template: {
        files: '**/template.html',
        tasks: ['inlinecss', 'cssmin']
       },
       options: {
        nospawn: true
       }
      },
      cssmin: {
       minify: {
        files: [{
          src: 'template.html',
          dest: 'email.html'
         }]
        }
       },
       inlinecss: {
        main: {
         files: [{
          src: 'same_dir',
          dest: 'same_dir'
         }]
        }
       }
      });

  // Load tastks
  grunt.loadNpmTasks('grunt-contrib-cssmin');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-inline-css');

  // Default Task(s)
  grunt.registerTask('default', ['watch']);

  grunt.event.on('watch', function(action, filepath) {

    if (minimatch(filepath, grunt.config('watch.template.files'))) {

     // Current Working Directory
     var cwd = filepath.replace(filepath.substr(filepath.lastIndexOf('/') + 1), '');

     // Destination
     var dest = cwd + 'email.html';

     grunt.config('inlinecss.main.files.0.src', [filepath]);
     grunt.config('inlinecss.main.files.0.dest', dest);
     grunt.config('cssmin.minify.files.0.src', [filepath]);
     grunt.config('cssmin.minify.files.0.dest', dest);

    }
   });

 };

I basically have a folder structure that contains a template.html and an email.html. I work within the template.html and on every save, it creates the email.html that inlines the css and minifies the code.

About this issue

  • Original URL
  • State: closed
  • Created 11 years ago
  • Comments: 42 (13 by maintainers)

Commits related to this issue

Most upvoted comments

Oh and a way to get around this issue if you run into it is: killall -9 node to kill all running node processes. That will close the rogue opened file descriptors.

I have the same issue.