lighthouse-php icon indicating copy to clipboard operation
lighthouse-php copied to clipboard

Audit of 'http://example.com' failed

Open jesperkraght opened this issue 7 years ago • 7 comments

Hi.

I'm having issues getting this to work in my Laravel Application. I've done everything as requested:

  1. Added the following to my composer.json.
    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/dzava/lighthouse-php"
        }
    ],
    "require": {
        "dzava/lighthouse": "dev-master",
    },
  1. Installed the library using composer require dzava/lighthouse
  2. 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?

jesperkraght avatar Jul 23 '19 08:07 jesperkraght

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());
    }
}

dzava avatar Jul 24 '19 10:07 dzava

That outputs the exact same error message: Audit of 'http://example.com' failed

jesperkraght avatar Jul 31 '19 06:07 jesperkraght

Got the same error ... anyone can help us ?

Thanks

AmityTek avatar Dec 16 '20 10:12 AmityTek

Check the value of $exception->getOutput() to see why it failed.

dzava avatar Dec 18 '20 15:12 dzava

http://prntscr.com/w76fw4 and I don't how to solve this

AmityTek avatar Dec 22 '20 15:12 AmityTek

Use the setChromePath($path) method to specify the location of the chrome binary.

dzava avatar Dec 22 '20 23:12 dzava

Even if I specify the location itsn't working ... always the same error

AmityTek avatar Dec 23 '20 14:12 AmityTek