GoogleChrome/lighthouse · error · Error

no script treemap data found

Error message

no script treemap data found

What it means

Thrown by openTreemap when the supplied Lighthouse Result lacks usable script-treemap-data. The function reads json.audits['script-treemap-data'].details and throws if that details object is absent. The script-treemap-data audit (which powers the module treemap view) must have been gathered and must carry a details payload.

Source

Thrown at report/renderer/open-tab.js:105

/**
 * Same as openViewer, but uses postMessage.
 * @param {LH.Result} lhr
 * @protected
 */
async function openViewerAndSendData(lhr) {
  const windowName = 'viewer-' + computeWindowNameSuffix(lhr);
  const url = getAppsOrigin() + '/viewer/';
  openTabAndSendData({lhr}, url, windowName);
}

/**
 * Opens a new tab to the treemap app and sends the JSON results using URL.fragment
 * @param {LH.Result} json
 */
function openTreemap(json) {
  const treemapData = json.audits['script-treemap-data'].details;
  if (!treemapData) {
    throw new Error('no script treemap data found');
  }

  /** @type {LH.Treemap.Options} */
  const treemapOptions = {
    lhr: {
      mainDocumentUrl: json.mainDocumentUrl,
      finalUrl: json.finalUrl,
      finalDisplayedUrl: json.finalDisplayedUrl,
      audits: {
        'script-treemap-data': json.audits['script-treemap-data'],
      },
      configSettings: {
        locale: json.configSettings.locale,
      },
    },
  };
  const url = getAppsOrigin() + '/treemap/';
  const windowName = 'treemap-' + computeWindowNameSuffix(json);

View on GitHub (pinned to 9515cd4e58)

Solutions

  1. Re-run Lighthouse with a config that includes the 'script-treemap-data' audit and a gatherer that produces details (the default desktop/mobile configs include it).
  2. Guard the UI entry point: only show the 'View Treemap' control when lhr.audits['script-treemap-data']?.details is truthy.
  3. If integrating programmatically, check the audit before calling openTreemap and skip/disable the action otherwise.

Example fix

// before
openTreemap(lhr);

// after
const treemapAudit = lhr.audits['script-treemap-data'];
if (treemapAudit?.details) {
  openTreemap(lhr);
} else {
  // hide/disable the treemap action
}
Defensive patterns

Strategy: type-guard

Validate before calling

const audit = lhr?.audits?.['script-treemap-data'];
if (audit?.details) {
  openTreemap(lhr);
} else {
  // hide or disable the 'View Treemap' control
}

Type guard

/** @param {LH.Result} lhr */
function hasTreemapData(lhr) {
  return Boolean(lhr?.audits?.['script-treemap-data']?.details);
}

Try / catch

try {
  openTreemap(lhr);
} catch (err) {
  if (err.message === 'no script treemap data found') {
    notify('This report has no script treemap data.');
  } else throw err;
}

Prevention

When it happens

Trigger: Calling openTreemap(lhr) where lhr.audits['script-treemap-data'] is undefined, or exists but has no/empty 'details'. This happens when the LHR was produced by a config or Lighthouse version that did not run the script-treemap-data audit.

Common situations: Older Lighthouse results predating the script-treemap-data audit; custom configs that filter out the audit; PSI/other sources that strip audit details; a report where gather failed so details were omitted.

Related errors


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