{"action":"created","issue":{"url":"https://api.github.com/repos/praveenvijayan/grunt-html-validation/issues/74","labels_url":"https://api.github.com/repos/praveenvijayan/grunt-html-validation/issues/74/labels{/name}","comments_url":"https://api.github.com/repos/praveenvijayan/grunt-html-validation/issues/74/comments","events_url":"https://api.github.com/repos/praveenvijayan/grunt-html-validation/issues/74/events","html_url":"https://github.com/praveenvijayan/grunt-html-validation/issues/74","id":63500196,"number":74,"title":"Loading \"html_validation.js\" tasks...ERROR and exit....","user":{"login":"prashantkoshta","id":1650758,"avatar_url":"https://avatars.githubusercontent.com/u/1650758?v=3","gravatar_id":"","url":"https://api.github.com/users/prashantkoshta","html_url":"https://github.com/prashantkoshta","followers_url":"https://api.github.com/users/prashantkoshta/followers","following_url":"https://api.github.com/users/prashantkoshta/following{/other_user}","gists_url":"https://api.github.com/users/prashantkoshta/gists{/gist_id}","starred_url":"https://api.github.com/users/prashantkoshta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/prashantkoshta/subscriptions","organizations_url":"https://api.github.com/users/prashantkoshta/orgs","repos_url":"https://api.github.com/users/prashantkoshta/repos","events_url":"https://api.github.com/users/prashantkoshta/events{/privacy}","received_events_url":"https://api.github.com/users/prashantkoshta/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-03-22T07:00:21Z","updated_at":"2015-05-19T11:55:35Z","closed_at":null,"body":"Getting following error -\r\nC:\\sample2>grunt\r\n>> Local Npm module \"grunt-install-dependencies\" not found. Is it installed?\r\nLoading \"html_validation.js\" tasks...ERROR\r\n>> TypeError: Cannot assign to read only property 'name' of function () {\r\n>>\r\n>>         // Merge task-specific and/or target-specific options with these defa\r\nults.\r\n>>         va...<omitted>... }\r\nWarning: Task \"css-validation\" not found. Use --force to continue.\r\n\r\n\r\nThis what i have in Gruntfile.js\r\n\r\n\r\nmodule.exports = function(grunt) {\r\n\r\n  // Project configuration.\r\n  grunt.initConfig({\r\n    pkg: grunt.file.readJSON('package.json'),\r\n\t\r\n\t\t'html-validation': {\r\n\t\t\toptions: {\r\n\t\t\t\treset: grunt.option('reset') || false,\r\n\t\t\t\tstoponerror: false,\r\n\t\t\t\t/*remotePath: \"http://decodize.com/\",\r\n\t\t\t\tremoteFiles: [\"html/moving-from-wordpress-to-octopress/\",\r\n\t\t\t\t\t\t\t\t\"css/site-preloading-methods/\"], //or \r\n\t\t\t\tremoteFiles: \"validation-files.json\", // JSON file contains array of page paths. \r\n\t\t\t\trelaxerror: [\"Bad value X-UA-Compatible for attribute http-equiv on element meta.\"] //ignores these errors */\r\n\t\t\t},\r\n\t\t\tfiles: {\r\n\t\t\t\tsrc: [\r\n\t\t\t\t\t'src/index.html',\r\n\t\t\t\t\t]\r\n\t\t\t}\r\n\t\t},\r\n\t\t \r\n\t\t'css-validation': {\r\n\t\t\toptions: {\r\n\t\t\t\treset: grunt.option('reset') || false,\r\n\t\t\t\tstoponerror:false,\r\n\t\t\t\trelaxerror: [],\r\n\t\t\t\tprofile: 'css3', // possible profiles are: none, css1, css2, css21, css3, svg, svgbasic, svgtiny, mobile, atsc-tv, tv \r\n\t\t\t\tmedium: 'all', // possible media are: all, aural, braille, embossed, handheld, print, projection, screen, tty, tv, presentation \r\n\t\t\t\twarnings: '0' // possible warnings are: 2 (all), 1 (normal), 0 (most important), no (no warnings) \r\n\t\t\t  },\r\n\t\t\t  files: {\r\n\t\t\t\tsrc: ['src/css/*.css']\r\n\t\t\t  }\r\n\t\t}\r\n\t\r\n    \r\n  });\r\n\t\r\n    grunt.loadNpmTasks('grunt-w3c-validation');\r\n    grunt.registerTask(\"default\", [\"html-validation\"]);\r\n    grunt.registerTask(\"default\", [\"css-validation\"]);\r\n\r\n};\r\n"},"comment":{"url":"https://api.github.com/repos/praveenvijayan/grunt-html-validation/issues/comments/103458151","html_url":"https://github.com/praveenvijayan/grunt-html-validation/issues/74#issuecomment-103458151","issue_url":"https://api.github.com/repos/praveenvijayan/grunt-html-validation/issues/74","id":103458151,"user":{"login":"jrauschenbusch","id":2499843,"avatar_url":"https://avatars.githubusercontent.com/u/2499843?v=3","gravatar_id":"","url":"https://api.github.com/users/jrauschenbusch","html_url":"https://github.com/jrauschenbusch","followers_url":"https://api.github.com/users/jrauschenbusch/followers","following_url":"https://api.github.com/users/jrauschenbusch/following{/other_user}","gists_url":"https://api.github.com/users/jrauschenbusch/gists{/gist_id}","starred_url":"https://api.github.com/users/jrauschenbusch/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrauschenbusch/subscriptions","organizations_url":"https://api.github.com/users/jrauschenbusch/orgs","repos_url":"https://api.github.com/users/jrauschenbusch/repos","events_url":"https://api.github.com/users/jrauschenbusch/events{/privacy}","received_events_url":"https://api.github.com/users/jrauschenbusch/received_events","type":"User","site_admin":false},"created_at":"2015-05-19T11:55:35Z","updated_at":"2015-05-19T11:55:35Z","body":"Same issue here. It's because of the 'use strict' in file html_validation.js in combination with the the first line of function getValidate. In strict mode, you are not allowed to overwrite a function name.\r\n\r\n```javascript\r\n'use strict';\r\n\r\nmodule.exports = function (grunt) {\r\n   \r\n   ...\r\n\r\n   var htmlValidation = 'html-validation';\r\n   var cssValidation = 'css-validation';\r\n\r\n   ...\r\n\r\n   var validate = function() {\r\n      ...\r\n   }\r\n\r\n   ...\r\n\r\n   function getValidate(validationType){\r\n      validate.name = validationType;\r\n      return validate;\r\n   }\r\n\r\n   grunt.registerMultiTask(htmlValidation, 'HTML W3C validation.', getValidate(htmlValidation));\r\n   grunt.registerMultiTask(cssValidation, 'CSS W3C validation.', getValidate(cssValidation));\r\n};\r\n```"}}