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

Grunt task results in recursion when we've registered a "node-sass" module and the task name is "sass" #1708

Closed
mohsentaleb opened this issue Apr 20, 2020 · 1 comment

Comments

@mohsentaleb
Copy link

Given the following task description in my GruntFile:

const sass = require("node-sass");

module.exports = function (grunt) {
  grunt.initConfig({
   sass: {
      options: {
        implementation: sass,
        //sourceMap: true,
      },
      dist: {
        files: {
          "css/custom-bootstrap.css": "css/scss/custom-bootstrap.scss",
        },
      },
    },
  });

  grunt.loadNpmTasks("grunt-sass");

  // Default task(s).
  grunt.registerTask("sass", ["sass"]);
  grunt.registerTask("default", [""]);
};

when I ran grunt sass , it took forever and then in verbose mode (grunt sass --verbose) I realized it's stuck in a recursion:

λ grunt sass --verbose
Initializing
Command-line options: --verbose, --gruntfile=c:\wwwRoot\template\Gruntfile.js

Reading "Gruntfile.js" Gruntfile...OK

Registering Gruntfile tasks.
Reading package.json...OK
Parsing package.json...OK
Initializing config...OK

Registering "grunt-svgstore" local Npm module tasks.
Reading c:\wwwRoot\template\node_modules\grunt-svgstore\package.json...OK
Parsing c:\wwwRoot\template\node_modules\grunt-svgstore\package.json...OK
Loading "svgstore.js" tasks...OK
+ svgstore

Registering "grunt-sass" local Npm module tasks.
Reading c:\wwwRoot\template\node_modules\grunt-sass\package.json...OK
Parsing c:\wwwRoot\template\node_modules\grunt-sass\package.json...OK
Loading "sass.js" tasks...OK
+ sass
Loading "Gruntfile.js" tasks...OK
+ default, icon, sass

Running tasks: sass

Running "sass" task

Running "sass" task

Running "sass" task

Running "sass" task

Running "sass" task

Running "sass" task

Running "sass" task

Running "sass" task

Running "sass" task

Running "sass" task

Running "sass" task

Running "sass" task

Running "sass" task

Running "sass" task

Running "sass" task

As soon as I rename my task to something else, problem is solved!

@vladikoff
Copy link
Member

dup of #1260

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

No branches or pull requests

2 participants