{"action":"created","issue":{"url":"https://api.github.com/repos/yeoman/grunt-usemin/issues/556","labels_url":"https://api.github.com/repos/yeoman/grunt-usemin/issues/556/labels{/name}","comments_url":"https://api.github.com/repos/yeoman/grunt-usemin/issues/556/comments","events_url":"https://api.github.com/repos/yeoman/grunt-usemin/issues/556/events","html_url":"https://github.com/yeoman/grunt-usemin/issues/556","id":75637783,"number":556,"title":"Cannot Read Property 'Version' Of Undefined","user":{"login":"mcintosh101","id":2189617,"avatar_url":"https://avatars.githubusercontent.com/u/2189617?v=3","gravatar_id":"","url":"https://api.github.com/users/mcintosh101","html_url":"https://github.com/mcintosh101","followers_url":"https://api.github.com/users/mcintosh101/followers","following_url":"https://api.github.com/users/mcintosh101/following{/other_user}","gists_url":"https://api.github.com/users/mcintosh101/gists{/gist_id}","starred_url":"https://api.github.com/users/mcintosh101/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcintosh101/subscriptions","organizations_url":"https://api.github.com/users/mcintosh101/orgs","repos_url":"https://api.github.com/users/mcintosh101/repos","events_url":"https://api.github.com/users/mcintosh101/events{/privacy}","received_events_url":"https://api.github.com/users/mcintosh101/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-05-12T15:18:44Z","updated_at":"2015-05-19T12:05:42Z","closed_at":null,"body":"Hi,\r\n\r\nWhen trying to build I get this error in the console:\r\n\r\n```javascript\r\nRunning \"useminPrepare:html\" (useminPrepare) task\r\n\r\nWarning: An error occurred while processing a template (Cannot read property 'version' of undefined). Use --force to continue.\r\n```\r\n\r\nAnd I can't work out how to solve it, does anyone know why this is happening?\r\n\r\ngruntfile.js\r\n```javascript\r\nuseminPrepare: {\r\n      options: {\r\n        dest: '<%= config.dist %>'\r\n      },\r\n      src: [\r\n        '<%= config.app %>/login.html',\r\n        '<%= config.app %>/projects.html',\r\n        '<%= config.app %>/project-drilldown.html',\r\n        '<%= config.app %>/analytics.html',\r\n        '<%= config.app %>/services.html',\r\n        '<%= config.app %>/stock.html'\r\n      ],\r\n    },\r\n```\r\n\r\nThanks."},"comment":{"url":"https://api.github.com/repos/yeoman/grunt-usemin/issues/comments/103461973","html_url":"https://github.com/yeoman/grunt-usemin/issues/556#issuecomment-103461973","issue_url":"https://api.github.com/repos/yeoman/grunt-usemin/issues/556","id":103461973,"user":{"login":"mcintosh101","id":2189617,"avatar_url":"https://avatars.githubusercontent.com/u/2189617?v=3","gravatar_id":"","url":"https://api.github.com/users/mcintosh101","html_url":"https://github.com/mcintosh101","followers_url":"https://api.github.com/users/mcintosh101/followers","following_url":"https://api.github.com/users/mcintosh101/following{/other_user}","gists_url":"https://api.github.com/users/mcintosh101/gists{/gist_id}","starred_url":"https://api.github.com/users/mcintosh101/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mcintosh101/subscriptions","organizations_url":"https://api.github.com/users/mcintosh101/orgs","repos_url":"https://api.github.com/users/mcintosh101/repos","events_url":"https://api.github.com/users/mcintosh101/events{/privacy}","received_events_url":"https://api.github.com/users/mcintosh101/received_events","type":"User","site_admin":false},"created_at":"2015-05-19T12:05:42Z","updated_at":"2015-05-19T12:05:42Z","body":"If anyone else is getting this problem. I hadn't declared the `pkg` config. It was trying to looking for the version from package.json (which was the undefined).\r\n\r\nI added this inside `grunt.initConfig`\r\n\r\n```javascript\r\npkg: grunt.file.readJSON('package.json')\r\n```\r\n"}}