{"record":{"id":"31a3666c835383fb","repo":"GoogleChrome/lighthouse","slug":"pluginname-supportedmodes-must-be-an-array-val","errorCode":null,"errorMessage":"${pluginName} supportedModes must be an array, valid array values are \"navigation\", \"timespan\", and \"snapshot\".","messagePattern":"(.+?) supportedModes must be an array, valid array values are \"navigation\", \"timespan\", and \"snapshot\"\\.","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"core/config/config-plugin.js","lineNumber":161,"sourceCode":"      manualDescription,\n      auditRefs: auditRefsJson,\n      supportedModes,\n      ...invalidRest\n    } = categoryJson;\n\n    assertNoExcessProperties(invalidRest, pluginName, 'category');\n\n    if (!i18n.isStringOrIcuMessage(title)) {\n      throw new Error(`${pluginName} has an invalid category tile.`);\n    }\n    if (!i18n.isStringOrIcuMessage(description) && description !== undefined) {\n      throw new Error(`${pluginName} has an invalid category description.`);\n    }\n    if (!i18n.isStringOrIcuMessage(manualDescription) && manualDescription !== undefined) {\n      throw new Error(`${pluginName} has an invalid category manualDescription.`);\n    }\n    if (!isArrayOfGatherModes(supportedModes) && supportedModes !== undefined) {\n      throw new Error(\n        `${pluginName} supportedModes must be an array, ` +\n        `valid array values are \"navigation\", \"timespan\", and \"snapshot\".`\n      );\n    }\n    const auditRefs = ConfigPlugin._parseAuditRefsList(auditRefsJson, pluginName);\n\n    return {\n      title,\n      auditRefs,\n      description: description,\n      manualDescription: manualDescription,\n      supportedModes,\n    };\n  }\n\n\n  /**\n   * Extract and validate groups JSON added by the plugin.","sourceCodeStart":143,"sourceCodeEnd":179,"githubUrl":"https://github.com/GoogleChrome/lighthouse/blob/9515cd4e58ebed69f78742d932b501c2cab8ad8f/core/config/config-plugin.js#L143-L179","documentation":"Thrown by ConfigPlugin._parseCategory when a plugin category's 'supportedModes' is present (not undefined) but is not an array whose every element is one of 'navigation', 'timespan', or 'snapshot' (isArrayOfGatherModes). supportedModes restricts which page-load gather modes the category runs in. A string, object, or an array containing invalid/misspelled values triggers it.","triggerScenarios":"Category sets supportedModes: 'navigation' (a string, not array), or supportedModes: ['nav','snapshot'] (typo 'nav'), or supportedModes: [123]. isArrayOfGatherModes returns false and config-plugin.js:161 throws.","commonSituations":"Using the singular mode name or abbreviations ('nav','timespans'). Passing a comma-separated string instead of an array. Misspelling a mode after upgrading to a Lighthouse version that added supportedModes.","solutions":["Use an array of valid modes: supportedModes: ['navigation','timespan','snapshot'] or a subset.","If you want all modes, omit supportedModes entirely (undefined is allowed and means unrestricted).","Double-check spelling: exactly 'navigation', 'timespan', 'snapshot' (lowercase)."],"exampleFix":"// before\ncategory: {title:'X', supportedModes:'navigation', auditRefs:[...]}\n// after\ncategory: {title:'X', supportedModes:['navigation','snapshot'], auditRefs:[...]}","handlingStrategy":"validation","validationCode":"const VALID = new Set(['navigation','timespan','snapshot']);\nif (cat.supportedModes !== undefined) {\n  if (!Array.isArray(cat.supportedModes) || !cat.supportedModes.every(m => VALID.has(m))) {\n    throw new TypeError('supportedModes must be an array of navigation/timespan/snapshot');\n  }\n}","typeGuard":"const MODES = new Set(['navigation','timespan','snapshot']);\nfunction isSupportedModes(v) {\n  return v === undefined || (Array.isArray(v) && v.every(m => MODES.has(m)));\n}","tryCatchPattern":"try {\n  await ConfigPlugin.parsePlugin(plugin, name);\n} catch (e) {\n  if (/supportedModes must be an array/.test(e.message)) console.error('Check supportedModes spelling/array');\n  throw e;\n}","preventionTips":["Always use an array even for a single mode.","Spell modes exactly: navigation, timespan, snapshot.","Omit supportedModes when you want all modes."],"tags":["config","lighthouse","plugin","validation","gather-mode"],"backgroundTag":null,"analyzedSha":"9515cd4e58ebed69f78742d932b501c2cab8ad8f","analyzedAt":"2026-08-13T06:28:10.346Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}