GoogleChrome/lighthouse · error · Error
${pluginName} supportedModes must be an array, valid array v
Error message
${pluginName} supportedModes must be an array, valid array values are "navigation", "timespan", and "snapshot". What it means
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.
Source
Thrown at core/config/config-plugin.js:161
manualDescription,
auditRefs: auditRefsJson,
supportedModes,
...invalidRest
} = categoryJson;
assertNoExcessProperties(invalidRest, pluginName, 'category');
if (!i18n.isStringOrIcuMessage(title)) {
throw new Error(`${pluginName} has an invalid category tile.`);
}
if (!i18n.isStringOrIcuMessage(description) && description !== undefined) {
throw new Error(`${pluginName} has an invalid category description.`);
}
if (!i18n.isStringOrIcuMessage(manualDescription) && manualDescription !== undefined) {
throw new Error(`${pluginName} has an invalid category manualDescription.`);
}
if (!isArrayOfGatherModes(supportedModes) && supportedModes !== undefined) {
throw new Error(
`${pluginName} supportedModes must be an array, ` +
`valid array values are "navigation", "timespan", and "snapshot".`
);
}
const auditRefs = ConfigPlugin._parseAuditRefsList(auditRefsJson, pluginName);
return {
title,
auditRefs,
description: description,
manualDescription: manualDescription,
supportedModes,
};
}
/**
* Extract and validate groups JSON added by the plugin.View on GitHub (pinned to 9515cd4e58)
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).
Example fix
// before
category: {title:'X', supportedModes:'navigation', auditRefs:[...]}
// after
category: {title:'X', supportedModes:['navigation','snapshot'], auditRefs:[...]} Defensive patterns
Strategy: validation
Validate before calling
const VALID = new Set(['navigation','timespan','snapshot']);
if (cat.supportedModes !== undefined) {
if (!Array.isArray(cat.supportedModes) || !cat.supportedModes.every(m => VALID.has(m))) {
throw new TypeError('supportedModes must be an array of navigation/timespan/snapshot');
}
} Type guard
const MODES = new Set(['navigation','timespan','snapshot']);
function isSupportedModes(v) {
return v === undefined || (Array.isArray(v) && v.every(m => MODES.has(m)));
} Try / catch
try {
await ConfigPlugin.parsePlugin(plugin, name);
} catch (e) {
if (/supportedModes must be an array/.test(e.message)) console.error('Check supportedModes spelling/array');
throw e;
} Prevention
- Always use an array even for a single mode.
- Spell modes exactly: navigation, timespan, snapshot.
- Omit supportedModes when you want all modes.
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- ${pluginName} has an invalid category description.
- ${pluginName} has an invalid category manualDescription.
- ${pluginName} groups json is not defined as an object.
- ${pluginName} has a group not defined as an object.
- ${pluginName} has an invalid group title.
AI-assisted analysis of GoogleChrome/lighthouse@9515cd4e58 (2026-08-13).
Data as JSON: /api/errors/31a3666c835383fb.
Report an issue: GitHub.