Audit of 'http://example.com' failed
Hi.
I'm having issues getting this to work in my Laravel Application. I've done everything as requested:
- Added the following to my composer.json.
"repositories": [
{
"type": "vcs",
"url": "https://github.com/dzava/lighthouse-php"
}
],
"require": {
"dzava/lighthouse": "dev-master",
},
- Installed the library using
composer require dzava/lighthouse - Installed Google Lighthouse using
yarn add lighthouse
But when I try to run it, I get an "Audit of 'DOMAIN-NAME' failed", no matter the URL.
I've also tried to use the setLighthousePath, but still the same.
public function LightHouseScan($url) {
return (new Lighthouse())
->setLighthousePath('../../node_modules/lighthouse/lighthouse-cli/index.js')
->setOutput('report.json')
->accessibility()
->bestPractices()
->performance()
->pwa()
->seo()
->audit($url);
}
Any idea why this is happening?
Try this to see why it fails
public function LightHouseScan($url) {
try {
return (new Lighthouse())
->setLighthousePath('../../node_modules/lighthouse/lighthouse-cli/index.js')
->setOutput('report.json')
->accessibility()
->bestPractices()
->performance()
->pwa()
->seo()
->audit($url);
} catch(AuditFailedException $e) {
dd($e->getOutput());
}
}
That outputs the exact same error message: Audit of 'http://example.com' failed
Got the same error ... anyone can help us ?
Thanks
Check the value of $exception->getOutput() to see why it failed.
http://prntscr.com/w76fw4 and I don't how to solve this
Use the setChromePath($path) method to specify the location of the chrome binary.
Even if I specify the location itsn't working ... always the same error