As I've ran in to this issue a number of times now, I'm writing it down in the hope I remember for future and others will find it useful.

If you register a custom grunt task that is named the same as a plugin's task, it will cause an infinite loop with zero output unless you use --verbose.

Here's an example:

    grunt.initConfig({
    curl: {
      'http://foo.com/api/': 'response.json'
    }
  });

  grunt.loadNpmTasks('grunt-curl');

  grunt.registerTask('curl', ['curl', 'other-tasks-to-run-afterwards']);
};

As 'curl' has been registered and also runs the (grunt-)curl task, when run with grunt curl, it will sit there and seemingly do nothing. In reality, if you ran grunt curl --verbose, you will see the following:

  Running "curl" task

Running "curl" task

Running "curl" task

Running "curl" task

Running "curl" task

Running "curl" task

Running "curl" task

Running "curl" task

Running "curl" task

Running "curl" task


... Repeated indefinitely

I hope this helps you and future me!


2,018 2 3