GoogleChrome/lighthouse · error · Error
Invalid Audit type
Error message
Invalid Audit type
What it means
Error "Invalid Audit type " thrown in GoogleChrome/lighthouse.
Source
Thrown at core/config/config-helpers.js:207
* Expands the audits from user-specified JSON to an internal audit definition format.
* @param {LH.Config.AuditJson} audit
* @return {{id?: string, path: string, options?: {}} | {id?: string, implementation: Audit, path?: string, options?: {}}}
*/
function expandAuditShorthand(audit) {
if (typeof audit === 'string') {
// just 'path/to/audit'
return {path: audit, options: {}};
} else if ('implementation' in audit && typeof audit.implementation.audit === 'function') {
// {implementation: AuditClass, ...}
return audit;
} else if ('path' in audit && typeof audit.path === 'string') {
// {path: 'path/to/audit', ...}
return audit;
} else if ('audit' in audit && typeof audit.audit === 'function') {
// just AuditClass
return {implementation: audit, options: {}};
} else {
throw new Error('Invalid Audit type ' + JSON.stringify(audit));
}
}
/** @type {Map<string, Promise<any>>} */
const bundledModules = new Map(/* BUILD_REPLACE_BUNDLED_MODULES */);
/**
* Wraps `import`/`require` with an entrypoint for bundled dynamic modules.
* See build-bundle.js
* @param {string} requirePath
*/
async function requireWrapper(requirePath) {
// For windows.
if (path.isAbsolute(requirePath)) {
requirePath = url.pathToFileURL(requirePath).href;
}
/** @type {any} */View on GitHub (pinned to 9515cd4e58)
Solutions
- Ensure the audit module exports a class that extends the base Audit class.
- Check that the audit's path in your config points to the correct file.
- Verify the audit class is exported as the default export.
When it happens
Trigger: Thrown when a configured audit does not extend the Audit base class or fails audit validation.
Common situations: See trigger scenarios.
AI-assisted analysis of GoogleChrome/lighthouse@9515cd4e58 (2026-08-13).
Data as JSON: /api/errors/7a4018de3bf92674.
Report an issue: GitHub.