GoogleChrome/lighthouse · error

No lantern metrics available, did you run run-on-all-assets.

Error message

No lantern metrics available, did you run run-on-all-assets.js?

What it means

Thrown by combineBaselineAndComputedDatasets() in Lantern's constants module. This function joins computed Lantern output (from run-on-all-assets.js) with baseline reference data (lantern-baseline-computed-values.json). After joining, it filters for sites that have BOTH a .lantern computation AND a .baseline. If zero sites match, it means the upstream computation step never ran successfully or its output doesn't overlap with the baseline fixture.

Source

Thrown at core/scripts/lantern/constants.js:103

  // prettier-ignore
  BASELINE_COMPUTED_PATH: path.join(LH_ROOT, 'core/test/fixtures/lantern-baseline-computed-values.json'),
  // prettier-ignore
  BASELINE_ACCURACY_PATH: path.join(LH_ROOT, 'core/test/fixtures/lantern-baseline-accuracy.json'),
  /**
   * @param {{sites: Array<LanternSiteDefinition>}} siteIndexWithComputed
   * @param {{sites: Array<LanternMetrics & {url: string}>}} baselineLanternData
   */
  combineBaselineAndComputedDatasets(siteIndexWithComputed, baselineLanternData) {
    for (const site of baselineLanternData.sites) {
      const computedSite = siteIndexWithComputed.sites.find(entry => entry.url === site.url);
      if (!computedSite) continue;
      computedSite.baseline = site;
    }

    const entries = siteIndexWithComputed.sites.filter(site => site.lantern && site.baseline);

    if (!entries.length) {
      throw new Error('No lantern metrics available, did you run run-on-all-assets.js?');
    }

    return entries;
  },

  /**
   * @param {LanternSiteDefinition} site
   * @param {TargetMetrics} expectedMetrics
   * @param {LanternMetrics} actualMetrics
   * @param {keyof TargetMetrics} metric
   * @param {keyof LanternMetrics} lanternMetric
   * @return {(LanternEvaluation & LanternSiteDefinition)|null}
   */
  evaluateSite(site, expectedMetrics, actualMetrics, metric, lanternMetric) {
    const expectedRaw = expectedMetrics[metric];
    if (expectedRaw === undefined) return null;

    const expected = Math.round(expectedRaw);

View on GitHub (pinned to 9515cd4e58)

Solutions

  1. Run run-on-all-assets.js first to generate .tmp/site-index-plus-golden-expectations-plus-computed.json
  2. Check stderr from run-on-all-assets.js — if every site errored, fix the root cause (missing trace files, wrong working directory)
  3. Verify that URLs in the site index JSON match URLs in core/test/fixtures/lantern-baseline-computed-values.json
  4. Confirm the computed file exists and contains sites with a populated .lantern property
Defensive patterns

Strategy: validation

Validate before calling

// Before calling combineBaselineAndComputedDatasets, verify the computed file exists
// and run-on-all-assets succeeded:
const fs = require('fs');
const computedPath = path.join(LH_ROOT, '.tmp/site-index-plus-golden-expectations-plus-computed.json');
if (!fs.existsSync(computedPath)) {
  console.error('Run run-on-all-assets.js first');
  process.exit(1);
}
const computed = readJson(computedPath);
const hasLantern = computed.sites.some(s => s.lantern);
if (!hasLantern) {
  console.error('No site has lantern data — check run-on-all-assets errors');
  process.exit(1);
}

Prevention

When it happens

Trigger: Called from print-correlations.js (line 35) and evaluateAllMetrics (constants.js:189). Fires when every site in siteIndexWithComputed.sites is missing either .lantern (computation never ran or errored on all sites) or .baseline (no URL match in baselineLanternData.sites). The check at line 100 filters for sites truthy on both properties; an empty result triggers the throw.

Common situations: Running print-correlations.js before run-on-all-assets.js (the computed .tmp file doesn't exist or is empty). run-on-all-assets.js silently failed on all sites — its per-site errors are caught and logged at line 58-60 without throwing, so Object.assign(site, {lantern}) never executes. URLs in the site index don't match URLs in the baseline fixture (trailing slash, http vs https, www prefix differences).

Related errors


AI-assisted analysis of GoogleChrome/lighthouse@9515cd4e58 (2026-08-13). Data as JSON: /api/errors/fd2ba8d77d0a2f21. Report an issue: GitHub.