{"action":"created","issue":{"url":"https://api.github.com/repos/jonkemp/gulp-useref/issues/39","labels_url":"https://api.github.com/repos/jonkemp/gulp-useref/issues/39/labels{/name}","comments_url":"https://api.github.com/repos/jonkemp/gulp-useref/issues/39/comments","events_url":"https://api.github.com/repos/jonkemp/gulp-useref/issues/39/events","html_url":"https://github.com/jonkemp/gulp-useref/issues/39","id":37498575,"number":39,"title":"useref choking for unknown reason","user":{"login":"thejohnfreeman","id":1133852,"avatar_url":"https://avatars.githubusercontent.com/u/1133852?v=3","gravatar_id":"","url":"https://api.github.com/users/thejohnfreeman","html_url":"https://github.com/thejohnfreeman","followers_url":"https://api.github.com/users/thejohnfreeman/followers","following_url":"https://api.github.com/users/thejohnfreeman/following{/other_user}","gists_url":"https://api.github.com/users/thejohnfreeman/gists{/gist_id}","starred_url":"https://api.github.com/users/thejohnfreeman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thejohnfreeman/subscriptions","organizations_url":"https://api.github.com/users/thejohnfreeman/orgs","repos_url":"https://api.github.com/users/thejohnfreeman/repos","events_url":"https://api.github.com/users/thejohnfreeman/events{/privacy}","received_events_url":"https://api.github.com/users/thejohnfreeman/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jonkemp/gulp-useref/labels/feature+request","name":"feature request","color":"207de5"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2014-07-09T19:12:10Z","updated_at":"2015-01-05T17:48:36Z","closed_at":"2015-01-05T17:48:36Z","body":"I've got useref in my gulp pipeline:\r\n\r\n```js\r\n  return gulp.src(['*.html', 'templates/*'], {cwd: 'www', base: 'www'})\r\n    .pipe(useref.assets())\r\n    .pipe(useref.restore())\r\n    .pipe(useref())\r\n    .pipe(gulp.dest('dist'))\r\n```\r\n\r\nEven with an index.html that has no useref directives in it, I get this error now:\r\n\r\n```\r\n/.../node_modules/gulp-useref/index.js:40\r\n        var output = useref(file.contents.toString());\r\n                                          ^\r\nTypeError: Cannot call method 'toString' of null\r\n    at Transform._transform (/.../node_modules/gulp-useref/index.js:40:43)\r\n    at Transform._read (/.../node_modules/gulp-useref/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:184:10)\r\n    at Transform._write (/.../node_modules/gulp-useref/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:172:12)\r\n    at doWrite (/.../node_modules/gulp-useref/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:238:10)\r\n    at clearBuffer (/.../node_modules/gulp-useref/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:317:5)\r\n    at onwrite (/.../node_modules/gulp-useref/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:275:7)\r\n    at WritableState.onwrite (/.../node_modules/gulp-useref/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:107:5)\r\n    at afterTransform (/.../node_modules/gulp-useref/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:104:5)\r\n    at TransformState.afterTransform (/.../node_modules/gulp-useref/node_modules/through2/node_modules/readable-stream/lib/_stream_transform.js:79:12)\r\n    at afterWrite (/.../node_modules/gulp-useref/node_modules/through2/node_modules/readable-stream/lib/_stream_writable.js:290:3)\r\n"},"comment":{"url":"https://api.github.com/repos/jonkemp/gulp-useref/issues/comments/68745927","html_url":"https://github.com/jonkemp/gulp-useref/issues/39#issuecomment-68745927","issue_url":"https://api.github.com/repos/jonkemp/gulp-useref/issues/39","id":68745927,"user":{"login":"thejohnfreeman","id":1133852,"avatar_url":"https://avatars.githubusercontent.com/u/1133852?v=3","gravatar_id":"","url":"https://api.github.com/users/thejohnfreeman","html_url":"https://github.com/thejohnfreeman","followers_url":"https://api.github.com/users/thejohnfreeman/followers","following_url":"https://api.github.com/users/thejohnfreeman/following{/other_user}","gists_url":"https://api.github.com/users/thejohnfreeman/gists{/gist_id}","starred_url":"https://api.github.com/users/thejohnfreeman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/thejohnfreeman/subscriptions","organizations_url":"https://api.github.com/users/thejohnfreeman/orgs","repos_url":"https://api.github.com/users/thejohnfreeman/repos","events_url":"https://api.github.com/users/thejohnfreeman/events{/privacy}","received_events_url":"https://api.github.com/users/thejohnfreeman/received_events","type":"User","site_admin":false},"created_at":"2015-01-05T17:48:36Z","updated_at":"2015-01-05T17:48:36Z","body":"I haven't been working on JavaScript projects lately, so I don't care to check if it's still an issue. I'll close this for now and re-open if I run into it again."}}