{"record":{"id":"357cea30d7b5271a","repo":"GoogleChrome/lighthouse","slug":"gatherer-for-artifactdefn-id-did-not-support-an","errorCode":null,"errorMessage":"Gatherer for ${artifactDefn.id} did not support any gather modes.","messagePattern":"Gatherer for (.+?) did not support any gather modes\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/config/validation.js","lineNumber":65,"sourceCode":"\n  if (config.categories?.[pluginName]) {\n    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\n  }\n}\n\n/**\n * Throws an error if the provided object does not implement the required gatherer interface.\n * @param {LH.Config.AnyArtifactDefn} artifactDefn\n */\nfunction assertValidArtifact(artifactDefn) {\n  const gatherer = artifactDefn.gatherer.instance;\n\n  if (typeof gatherer.meta !== 'object') {\n    throw new Error(`Gatherer for ${artifactDefn.id} did not provide a meta object.`);\n  }\n\n  if (gatherer.meta.supportedModes.length === 0) {\n    throw new Error(`Gatherer for ${artifactDefn.id} did not support any gather modes.`);\n  }\n\n  if (\n    typeof gatherer.getArtifact !== 'function' ||\n    gatherer.getArtifact === BaseGatherer.prototype.getArtifact\n  ) {\n    throw new Error(`Gatherer for ${artifactDefn.id} did not define a \"getArtifact\" method.`);\n  }\n}\n\n/**\n * Throws an error if the provided object does not implement the required properties of an audit\n * definition.\n * @param {LH.Config.AuditDefn} auditDefinition\n */\nfunction assertValidAudit(auditDefinition) {\n  const {implementation, path: auditPath} = auditDefinition;\n  const auditName = auditPath ||","sourceCodeStart":47,"sourceCodeEnd":83,"githubUrl":"https://github.com/GoogleChrome/lighthouse/blob/9515cd4e58ebed69f78742d932b501c2cab8ad8f/core/config/validation.js#L47-L83","documentation":"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.","triggerScenarios":"A gatherer extends BaseGatherer (meta.supportedModes defaults to []) but never overrides supportedModes, so the array length is 0. validation.js:65 throws.","commonSituations":"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.","solutions":["Declare the modes your gatherer supports: meta = {supportedModes: ['snapshot']}.","Use the appropriate mode(s): 'navigation' for full page loads, 'timespan' for in-page interactions, 'snapshot' for one-off DOM reads.","If unsure, 'snapshot' is the safest minimal mode for read-only gatherers."],"exampleFix":"// before\nclass MyGatherer extends BaseGatherer {\n  getArtifact() {...}\n}\n// after\nclass MyGatherer extends BaseGatherer {\n  meta = {supportedModes: ['snapshot']};\n  getArtifact() {...}\n}","handlingStrategy":"validation","validationCode":"const MODES = new Set(['navigation','timespan','snapshot']);\nfunction assertSupportedModes(g) {\n  const modes = g.meta?.supportedModes || [];\n  if (!modes.length || !modes.every(m => MODES.has(m))) {\n    throw new TypeError(`Gatherer must declare at least one valid supportedMode`);\n  }\n}","typeGuard":"function gathererHasModes(g) {\n  return Array.isArray(g.meta?.supportedModes) && g.meta.supportedModes.length > 0;\n}","tryCatchPattern":"try { new Config(config, {configPath}); }\ncatch (e) { if (/did not support any gather modes/.test(e.message)) console.error('Set meta.supportedModes'); throw e; }","preventionTips":["Always set meta.supportedModes to at least one valid mode.","Default read-only gatherers to ['snapshot'].","Test gatherers for a non-empty supportedModes array."],"tags":["config","lighthouse","gatherer","validation","gather-mode"],"backgroundTag":null,"analyzedSha":"9515cd4e58ebed69f78742d932b501c2cab8ad8f","analyzedAt":"2026-08-13T06:28:10.346Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}