Lighthouse plugin can't find content

I’ve enabled the lighthouse plugin for my site, but I get this error:

1:33:13 PM: Generating Lighthouse report. This may take a minute…
1:33:13 PM: Running Lighthouse on docs/
1:33:13 PM: Serving and scanning site from directory docs
1:33:19 PM: ERRORED_DOCUMENT_REQUEST
1:33:19 PM: Lighthouse was unable to reliably load the page you requested. Make sure you are testing the correct URL and that the server is properly responding to all requests. (Status code: 404)

docs/ is my base directory. The site works - all content is served from that directory.

Hi can you share your site name I’m not sure why this is happening but I can check on the backend.

Hey @SamO , it’s https://grand-lokum-795b84.netlify.app/

thanks :smile:

Hi @jake1,

You may need to define [[plugins]] in the netlify.toml file. You can learn more here: GitHub - netlify/netlify-plugin-lighthouse: Netlify Plugin to run Lighthouse on each build

By default, the plugin will serve and audit the build directory of the site, inspecting the index.html . You can customize the behavior via the audits input:


[[plugins]]
  package = "@netlify/plugin-lighthouse"

  [plugins.inputs.thresholds]
    performance = 0.9

  # to audit a sub path of the build directory
  # route1 audit will use the top level thresholds
  [[plugins.inputs.audits]]
    path = "route1"

    # you can specify output_path per audit, relative to the path
    output_path = "reports/route1.html"

  # to audit an HTML file other than index.html in the build directory
  [[plugins.inputs.audits]]
    path = "contact.html"

  # to audit an HTML file other than index.html in a sub path of the build directory
  [[plugins.inputs.audits]]
    path = "pages/contact.html"

  # to audit a specific absolute url
  [[plugins.inputs.audits]]
    url = "https://www.example.com"

    # you can specify thresholds per audit
    [plugins.inputs.audits.thresholds]
      performance = 0.8

  # to serve only a sub directory of the build directory for an audit
  # pages/index.html will be audited, and files outside of this directory will not be served
  [[plugins.inputs.audits]]
    serveDir = "pages"