GoogleChrome/lighthouse · error

Gatherer for did not support any gather modes.

Error message

Gatherer for ${artifactDefn.id} did not support any gather modes.

What it means

Thrown by assertValidArtifact in validation.js. A gatherer's meta.supportedModes array must contain at least one valid gather mode ('navigation','timespan','snapshot'). BaseGatherer defaults supportedModes to [] (meaning 'unspecified'), and a gatherer that never declares modes leaves it empty, which is invalid for an artifact gatherer. Lighthouse needs to know in which modes to run it.

Solutions

  1. Declare the modes your gatherer supports: meta = {supportedModes: ['snapshot']}.
  2. Use the appropriate mode(s): 'navigation' for full page loads, 'timespan' for in-page interactions, 'snapshot' for one-off DOM reads.
  3. If unsure, 'snapshot' is the safest minimal mode for read-only gatherers.

Example fix

// before
class MyGatherer extends BaseGatherer {
  getArtifact() {...}
}
// after
class MyGatherer extends BaseGatherer {
  meta = {supportedModes: ['snapshot']};
  getArtifact() {...}
}
Defensive patterns

Strategy: validation

Validate before calling

const MODES = new Set(['navigation','timespan','snapshot']);
function assertSupportedModes(g) {
  const modes = g.meta?.supportedModes || [];
  if (!modes.length || !modes.every(m => MODES.has(m))) {
    throw new TypeError(`Gatherer must declare at least one valid supportedMode`);
  }
}

Type guard

function gathererHasModes(g) {
  return Array.isArray(g.meta?.supportedModes) && g.meta.supportedModes.length > 0;
}

Try / catch

try { new Config(config, {configPath}); }
catch (e) { if (/did not support any gather modes/.test(e.message)) console.error('Set meta.supportedModes'); throw e; }

Prevention

When it happens

Trigger: A gatherer extends BaseGatherer (meta.supportedModes defaults to []) but never overrides supportedModes, so the array length is 0. validation.js:65 throws.

Common situations: Writing a new gatherer and forgetting to set meta.supportedModes. Extending BaseGatherer whose default is an empty array. Migrating an old gatherer that used a different modes API.

Related errors


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

Appendix: source

Thrown at core/config/validation.js:65

  if (config.categories?.[pluginName]) {
    throw new Error(`plugin name '${pluginName}' not allowed because it is the id of a category already found in config`); // eslint-disable-line max-len
  }
}

/**
 * Throws an error if the provided object does not implement the required gatherer interface.
 * @param {LH.Config.AnyArtifactDefn} artifactDefn
 */
function assertValidArtifact(artifactDefn) {
  const gatherer = artifactDefn.gatherer.instance;

  if (typeof gatherer.meta !== 'object') {
    throw new Error(`Gatherer for ${artifactDefn.id} did not provide a meta object.`);
  }

  if (gatherer.meta.supportedModes.length === 0) {
    throw new Error(`Gatherer for ${artifactDefn.id} did not support any gather modes.`);
  }

  if (
    typeof gatherer.getArtifact !== 'function' ||
    gatherer.getArtifact === BaseGatherer.prototype.getArtifact
  ) {
    throw new Error(`Gatherer for ${artifactDefn.id} did not define a "getArtifact" method.`);
  }
}

/**
 * Throws an error if the provided object does not implement the required properties of an audit
 * definition.
 * @param {LH.Config.AuditDefn} auditDefinition
 */
function assertValidAudit(auditDefinition) {
  const {implementation, path: auditPath} = auditDefinition;
  const auditName = auditPath ||

View on GitHub (pinned to 9515cd4e58)