Skip to content

An audit of a page that fails to load returns a normal result without Lighthouse's runtimeError #2967

Closed

Description

@coygeek

Description of the bug

When Lighthouse cannot load the audited page (here an HTTP 404 document), it records the failure in lhr.runtimeError and lhr.runWarnings and leaves every category unscored. lighthouse_audit returns isError: false with every category printed as 0, Passed: 0, Failed: 0, and no mention of the failure. The agent receives what looks like a completed audit of a very bad page instead of "the page could not be audited, status 404".

Actual behavior

Both builds, lighthouse_audit text result (isError: false):

## Lighthouse Audit Results
Mode: navigation
Device: desktop
URL: http://127.0.0.1:PORT/nope.html
### Category Scores
- Accessibility: 0 (accessibility)
- Best Practices: 0 (best-practices)
- SEO: 0 (seo)
- Agentic Browsing: 0 (agentic-browsing)
### Audit Summary
Passed: 0
Failed: 0
Total Timing: 3602.11ms
### Reports
- <tmp>/lh404/report.json
- <tmp>/lh404/report.html

The report.json written by the same call:

{
  "runtimeError": "ERRORED_DOCUMENT_REQUEST",
  "message": "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)",
  "runWarnings": ["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)"],
  "scores": {"accessibility": null, "best-practices": null, "seo": null, "agentic-browsing": null}
}

Reproduction

  1. Run a loopback HTTP server that answers GET /nope.html with status 404. The observed runs used a small Node.js server that returns 404, content-type: text/plain, body nf; python3 -m http.server in an empty directory should behave the same but was not run.

  2. Start the server under test with the flags above and send (<tmp> is a directory inside the server's allowed roots, such as the OS temp directory):

{"name":"new_page","arguments":{"url":"http://127.0.0.1:PORT/nope.html"}}
{"name":"lighthouse_audit","arguments":{"pageId":2,"outputDirPath":"<tmp>/lh404"}}
  1. Inspect <tmp>/lh404/report.json: jq '{runtimeError: .runtimeError.code, message: .runtimeError.message, runWarnings, scores: (.categories|map_values(.score))}'.

The sequence was run once per build with identical results; an earlier independent run on both builds gave the same output.

Expectation

lighthouse_audit is described as "Get Lighthouse score and reports for accessibility, SEO, best practices, and agentic browsing". When Lighthouse reports that it could not audit the page (runtimeError set, categories unscored), the tool result says so, carrying Lighthouse's message (for example "Lighthouse was unable to reliably load the page you requested ... (Status code: 404)"). How unscored categories are rendered is tracked in #2915. Whether this is an error result or a result with a prominent warning is a maintainer choice; either way the failure is visible in the text an MCP client receives.

MCP configuration

--headless --isolated --no-usage-statistics --no-performance-crux unless the reproduction states otherwise (update checks disabled with CHROME_DEVTOOLS_MCP_NO_UPDATE_CHECKS=1).

Chrome DevTools MCP version

1.10.1 (npm) and main 5ddb0a3 (local build)

Chrome version

154.0.8037.98 (stable)

Node version

v22.23.2

Operating system

macOS 27.0

Environment details

  • chrome-devtools-mcp 1.10.1 from npm (the release build).
  • chrome-devtools-mcp built from main at commit 5ddb0a3 (the main build).
  • Google Chrome 154.0.8037.98 stable, headless; Node v22.23.2; macOS 27.
  • Both builds were started with --headless --isolated --no-usage-statistics --no-performance-crux and CHROME_DEVTOOLS_MCP_NO_UPDATE_CHECKS=1, and driven by a scripted stdio MCP client.

Evidence

  • Expected source: lighthouse_audit description in src/tools/lighthouse.ts and docs/tool-reference.md (both builds); Lighthouse's result type, types/lhr/lhr.d.ts:43-44 (from the lighthouse 13.5.0 devDependency; the runtime bundle in both builds reports Lighthouse 13.4.1): runtimeError is "A top-level error message that, if present, indicates a serious enough problem that this Lighthouse result may need to be discarded."
  • Failure source: scripted MCP runs above on both builds, with the saved report.json as the record of what Lighthouse returned. On the main build the handler builds its summary from lhr.categories, lhr.audits and lhr.timing only (src/tools/lighthouse.ts:159-192); lhr.runtimeError and lhr.runWarnings are not read in src/tools/lighthouse.ts or src/McpResponse.ts.
  • Evidence provenance: observed
  • Local verification: reproduced
  • Reproduction completeness: complete

Fix check

With the steps above, the lighthouse_audit response for the 404 page includes Lighthouse's runtime error message (or code), so the agent can tell that the page was not audited. How unscored categories are rendered (0 today, n/a with PR #2924) belongs to #2915 and is not part of this check. As a control, an audit of a page that loads with status 200 returns the same summary as today, and a run whose only problem is an unscored category without a runtimeError (the case in #2915) is not reported as a page-load failure.

Additional context

The full open and closed issue and PR corpus was screened as of 2026-10-06. Open #2915 ("lighthouse_audit summary prints a null category score as 0") and open PR #2924, which would print n/a for null scores, address the score rendering only; after #2924 this case would print four n/a scores, still with isError: false and no reason. Open PR #2930 adds failing audits to the response and does not read runtimeError either. Neither touches runtimeError or runWarnings.

Activity

  1. added theissue type on Oct 13, 2026
  2. added a commit that references this issue on Oct 16, 2026
    53ea78d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions