grunt ngtemplates task 100% cpu

The grunt task ngtemplates runs indefinitely (almost an hour and not finished) with 100% cpu utilisation. If i comment this task, then the build finishes. And the build task with ngtemplates runs and completes OK on another machine. Any ideas/clues are much appreciated.

Node version: 0.10.29 grunt-cli: v0.1.13 grunt: v0.4.5

ngtemplates: {
            app: {
                cwd: '<%= yeoman.app %>',
                src: ['views/{,*/}*.html', 'views/inbox/{,*/}*.html' , 'scripts/directives/*.html'],
                dest: 'scripts/templates.js',
                options: {
                    usemin: 'scripts/scripts.js', // <~~ This came from the <!-- build:js --> block
                    htmlmin: {
                        collapseBooleanAttributes: true,
                        collapseWhitespace: true,
                        removeAttributeQuotes: true,
                        removeComments: true, // Only if you don't use comment directives!
                        removeEmptyAttributes: true,
                        removeRedundantAttributes: true,
                        removeScriptTypeAttributes: true,
                        removeStyleLinkTypeAttributes: true
                    }
                }
            }
        }

Many thanks,

I had the same problem, I really do not know but that should be solved by removing eliminating the line about 73 .map (this.minify) from "node_modules/grunt-angular-templates/task/lib/ compiler.js"

Using @isidro-martinez solution you may find the real issue. My problem was an undeteced syntax error on my JS. I've been able to find it thank to temporarilly removing the line in the previouse comment:

I had the same problem, I really do not know but that should be solved by removing eliminating the line about 73 .map (this.minify) from "node_modules/grunt-angular-templates/task/lib/ compiler.js"

I had a similar problem when running my build with grunt and the ngtemplates task wouldn't complete.

I can confirm that the answer above to comment out line 73 of "node_modules/grunt-angular-templates/task/lib/ compiler.js" does allow the task to complete. However, this is not likely the problem (and you lose out on the minification of the files if you comment that line).

For me, I had an HTML syntax error in one of my HTML files. I discovered this by running my files through w3's HTML validator. After I fixed the syntax error, the ngtemplates task completed for me.