GoogleChrome/lighthouse · error · LighthouseError
NO_LCP
NO_LCP
Error message
The page did not display content that qualifies as a Largest Contentful Paint (LCP). Ensure the page has a valid LCP element and then try again. ({errorCode}) What it means
Thrown as a LighthouseError with code NO_LCP when computeObservedMetric() for the standard LargestContentfulPaint metric finds that processedNavigation.timings.largestContentfulPaint is undefined. This is the primary LCP failure path: the page never produced a qualifying Largest Contentful Paint during the observed trace. Lighthouse cannot compute a timing value for the metric.
Source
Thrown at core/computed/metrics/largest-contentful-paint.js:38
class LargestContentfulPaint extends NavigationMetric {
/**
* @param {LH.Artifacts.NavigationMetricComputationData} data
* @param {LH.Artifacts.ComputedContext} context
* @return {Promise<LH.Artifacts.LanternMetric>}
*/
static computeSimulatedMetric(data, context) {
const metricData = NavigationMetric.getMetricComputationInput(data);
return LanternLargestContentfulPaint.request(metricData, context);
}
/**
* @param {LH.Artifacts.NavigationMetricComputationData} data
* @return {Promise<LH.Artifacts.Metric>}
*/
static async computeObservedMetric(data) {
const {processedNavigation} = data;
if (processedNavigation.timings.largestContentfulPaint === undefined) {
throw new LighthouseError(LighthouseError.errors.NO_LCP);
}
return {
timing: processedNavigation.timings.largestContentfulPaint,
timestamp: processedNavigation.timestamps.largestContentfulPaint,
};
}
}
const LargestContentfulPaintComputed = makeComputedArtifact(
LargestContentfulPaint,
['devtoolsLog', 'gatherContext', 'settings', 'simulator', 'trace', 'URL', 'SourceMaps', 'HostDPR']
);
export {LargestContentfulPaintComputed as LargestContentfulPaint};
View on GitHub (pinned to 9515cd4e58)
Solutions
- Ensure the page renders at least one visible content block (text, image, video poster) above the fold
- Use a Chrome version that supports LCP (72+) and run in a visible or new-headless window
- If using programmatic trace collection, include 'disabled-by-default-largestContentfulPaint' in trace categories
- Verify no JavaScript error prevents content rendering before the trace ends
Defensive patterns
Strategy: try-catch
Validate before calling
// Pre-check LCP timing before requesting the metric
const processedNavigation = await ProcessedNavigation.request(trace, context);
if (processedNavigation.timings.largestContentfulPaint === undefined) {
// No LCP — metric cannot be computed
return { timing: undefined, notApplicable: true };
} Type guard
/** @type {(nav: LH.Artifacts.ProcessedNavigation) => nav is LH.Artifacts.ProcessedNavigation & {timings: {largestContentfulPaint: number}}} */
function hasLCP(nav) {
return typeof nav.timings.largestContentfulPaint === 'number';
} Try / catch
try {
const lcp = await LargestContentfulPaint.request(data, context);
} catch (e) {
if (e instanceof LighthouseError && e.code === 'NO_LCP') {
// Page has no LCP — mark metric as not applicable
return { notApplicable: true, reason: 'NO_LCP' };
}
throw e;
} Prevention
- Ensure the page renders visible content above the fold
- Use Chrome 72+ with --headless=new or headed mode
- Include 'disabled-by-default-largestContentfulPaint' in trace categories for manual collection
- Pre-check processedNavigation.timings.largestContentfulPaint before requesting LCP
When it happens
Trigger: Running the LargestContentfulPaint computed artifact in observed mode on a trace where no LCP candidate event was emitted by the browser. The check `processedNavigation.timings.largestContentfulPaint === undefined` is true, triggering the throw.
Common situations: Pages with no visible content at load time (blank pages, login walls, JS-rendered SPAs that fail). Background tabs where paint is deferred. Traces collected with insufficient trace categories. Pages where content appears but is below the fold or in a display:none container.
Related errors
AI-assisted analysis of GoogleChrome/lighthouse@9515cd4e58 (2026-08-13).
Data as JSON: /api/errors/aac2798206d52fe3.
Report an issue: GitHub.