outaTiME / grunt-replace

Replace text patterns with applause.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Recursive process.nextTick detected

markusfalk opened this issue · comments

Updated all to the latest version now I get this with every config:

(node) warning: Recursive process.nextTick detected. This will break in the next version of node. Please use setImmediate for recursive deferral.

util.js:35
  var str = String(f).replace(formatRegExp, function(x) {
                      ^
RangeError: Maximum call stack size exceeded

using

"grunt": "^0.4.5",
"grunt-replace": "^0.7.8"
node -v: v0.10.29
npm -v: 1.4.14

and

replace: {
  development: {
    options: {
      patterns: [
        // {
        //   match: /{{(.+)}}/g,
        //   replacement: function (match, placeholder) {
        //     return grunt.file.read("partials/" + placeholder + ".html");
        //   }
        // }
        {
          match: 'timestamp',
          replacement: '<%= new Date().getTime() %>'
        }
      ]
    },
    files: [
      {
        expand: true,
        flatten: true,
        src: ['*.html'],
        dest: 'build/'
      }
    ]
  }
}

is it me? :) thanks

mmmm, wooow strange ... that error comes from grunt-replace plugin ?? util.js is not mine ^^

how many grunt rules are you executing ??

its possible to share the gruntfile ??

The error occurs when I run the replace task with others or alone

module.exports = function(grunt) {

  grunt.initConfig({
    pkg: grunt.file.readJSON( 'package.json' ),

    watch: {
      options: {
        livereload: true,
        spawn: false
      },

      scss: {
        files: '**/*.scss',
        tasks: ['compass:development']
      },

      js: {
        files: '**/*.js',
        tasks: [],
      },

      html: {
        files: '**/*.html',
        tasks: [],
      }
    },

    compass: {
      options: {
        // httpPath: "/",
        banner: "/* <%= pkg.author %>, Version: <%= pkg.version %> */",
        cssDir: 'build/assets/css',
        // imagesDir: 'assets/img',
        noLineComments: false,
        sassDir: 'assets/scss',
        specify: "assets/scss/*.scss"
      },
      development: {
        options: {
          environment: 'development'
        }
      },
      production: {
        options: {
          environment: 'production'
        }
      }
    },

    replace: {
      development: {
        options: {
          patterns: [
            // {
            //   match: /{{(.+)}}/g,
            //   replacement: function (match, placeholder) {
            //     return grunt.file.read("partials/" + placeholder + ".html");
            //   }
            // }
            {
              match: 'timestamp',
              replacement: '<%= new Date().getTime() %>'
            }
          ]
        },
        files: [
          {
            expand: true,
            flatten: true,
            src: ['*.html'],
            dest: 'build/'
          }
        ]
      }
    }

  });

  grunt.loadNpmTasks('grunt-contrib-compass');
  grunt.loadNpmTasks('grunt-contrib-watch');
  grunt.loadNpmTasks('grunt-replace');

  grunt.registerTask('default', ['replace:development', 'compass:development']);
  grunt.registerTask('replace', 'replace');

};

verbose output:

Registering "grunt-replace" local Npm module tasks.
Reading /frontend-template-setup/node_modules/grunt-replace/package.json...OK
Parsing /frontend-template-setup/node_modules/grunt-replace/package.json...OK
Loading "replace.js" tasks...OK
+ replace
Loading "gruntfile.js" tasks...OK
+ default, replace

then the task gets executed about 1000 times

Running "replace" task
Running "replace" task
Running "replace" task
...

then the error occurs. also 1000x.

Woow, i dont like the task name 'replace' that you are registering ... probably it generates some kind of recursion with the grunt-replace ... you might change this line ...

grunt.registerTask('replace', 'replace');

with:

grunt.registerTask('replace-foo', 'replace');

that is it! thanks alot