{"action":"closed","issue":{"url":"https://api.github.com/repos/GoogleChrome/lighthouse/issues/5928","repository_url":"https://api.github.com/repos/GoogleChrome/lighthouse","labels_url":"https://api.github.com/repos/GoogleChrome/lighthouse/issues/5928/labels{/name}","comments_url":"https://api.github.com/repos/GoogleChrome/lighthouse/issues/5928/comments","events_url":"https://api.github.com/repos/GoogleChrome/lighthouse/issues/5928/events","html_url":"https://github.com/GoogleChrome/lighthouse/issues/5928","id":355065791,"node_id":"MDU6SXNzdWUzNTUwNjU3OTE=","number":5928,"title":"generateReport is not a function","user":{"login":"motiejuss","id":888798,"node_id":"MDQ6VXNlcjg4ODc5OA==","avatar_url":"https://avatars1.githubusercontent.com/u/888798?v=4","gravatar_id":"","url":"https://api.github.com/users/motiejuss","html_url":"https://github.com/motiejuss","followers_url":"https://api.github.com/users/motiejuss/followers","following_url":"https://api.github.com/users/motiejuss/following{/other_user}","gists_url":"https://api.github.com/users/motiejuss/gists{/gist_id}","starred_url":"https://api.github.com/users/motiejuss/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/motiejuss/subscriptions","organizations_url":"https://api.github.com/users/motiejuss/orgs","repos_url":"https://api.github.com/users/motiejuss/repos","events_url":"https://api.github.com/users/motiejuss/events{/privacy}","received_events_url":"https://api.github.com/users/motiejuss/received_events","type":"User","site_admin":false},"labels":[{"id":703688259,"node_id":"MDU6TGFiZWw3MDM2ODgyNTk=","url":"https://api.github.com/repos/GoogleChrome/lighthouse/labels/pending-close","name":"pending-close","color":"bfbfbf","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-08-29T09:06:13Z","updated_at":"2018-08-30T12:35:41Z","closed_at":"2018-08-30T12:35:41Z","author_association":"NONE","body":"Hi, \r\n\r\nHaving issues generating a report which used to work in v2. \r\n\r\nExample:\r\n\r\n```\r\nconst fs = require('fs');\r\nconst lighthouse = require('lighthouse');\r\nconst chromeLauncher = require('chrome-launcher');\r\nconst ReportGenerator = require('lighthouse/lighthouse-core/report/report-generator');\r\nfunction launchChromeAndRunLighthouse(url, opts, config = null) {\r\n  return chromeLauncher.launch({chromeFlags: opts.chromeFlags}).then(chrome => {\r\n    opts.port = chrome.port;\r\n    return lighthouse(url, opts, config).then(results => {\r\n      // use results.lhr for the JS-consumeable output\r\n      // https://github.com/GoogleChrome/lighthouse/blob/master/typings/lhr.d.ts\r\n      // use results.report for the HTML/JSON/CSV output as a string\r\n      // use results.artifacts for the trace/screenshots/other specific case you need (rarer)\r\n\t  delete results.artifacts;\r\n      return chrome.kill().then(() => results.lhr)\r\n    });\r\n  });\r\n}\r\nconst opts = {\r\n  chromeFlags: ['--headless', '--no-sandbox']\r\n};\r\n// Usage:\r\nlaunchChromeAndRunLighthouse('https://www.google.com/', opts).then(results => {\r\n\tlet report = new ReportGenerator().generateReport(results, 'html');\t\r\n\tfs.writeFileSync(\"report.html\", report);\r\n});\r\n```\r\n\r\nError:\r\n```\r\n(node:19128) UnhandledPromiseRejectionWarning: TypeError: (intermediate value).generateReport is not a function\r\n    at launchChromeAndRunLighthouse.then.results (..\\index.js:26:37)\r\n    at <anonymous>\r\n(node:19128) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)\r\n(node:19128) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.\r\n```\r\n\r\nAny suggestions?\r\n\r\nLighthouse version 3.0.3"}}
{"actor":{"display_login":"motiejuss"}}