{"record":{"id":"fca82aa5716c861e","repo":"GoogleChrome/lighthouse","slug":"auditname-has-no-meta-id-property-or-the-prope","errorCode":null,"errorMessage":"${auditName} has no meta.id property, or the property is not a string.","messagePattern":"(.+?) has no meta\\.id property, or the property is not a string\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/config/validation.js","lineNumber":92,"sourceCode":"}\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 ||\n    implementation?.meta?.id ||\n    'Unknown audit';\n\n  if (typeof implementation.audit !== 'function' || implementation.audit === Audit.audit) {\n    throw new Error(`${auditName} has no audit() method.`);\n  }\n\n  if (typeof implementation.meta.id !== 'string') {\n    throw new Error(`${auditName} has no meta.id property, or the property is not a string.`);\n  }\n\n  if (!i18n.isStringOrIcuMessage(implementation.meta.title)) {\n    throw new Error(`${auditName} has no meta.title property, or the property is not a string.`);\n  }\n\n  // If it'll have a ✔ or ✖ displayed alongside the result, it should have failureTitle\n  const scoreDisplayMode = implementation.meta.scoreDisplayMode || Audit.SCORING_MODES.BINARY;\n  if (\n    !i18n.isStringOrIcuMessage(implementation.meta.failureTitle) &&\n    scoreDisplayMode === Audit.SCORING_MODES.BINARY\n  ) {\n    throw new Error(`${auditName} has no meta.failureTitle and should.`);\n  }\n\n  if (!i18n.isStringOrIcuMessage(implementation.meta.description)) {\n    throw new Error(\n      `${auditName} has no meta.description property, or the property is not a string.`","sourceCodeStart":74,"sourceCodeEnd":110,"githubUrl":"https://github.com/GoogleChrome/lighthouse/blob/9515cd4e58ebed69f78742d932b501c2cab8ad8f/core/config/validation.js#L74-L110","documentation":"Thrown by assertValidAudit in validation.js. After confirming audit() exists, Lighthouse checks implementation.meta.id is a string (typeof === 'string'). meta.id is the audit's unique identifier referenced by categories/auditRefs. A missing meta, a non-string id (number, undefined), or a meta object without id fails the check.","triggerScenarios":"An audit class returns meta without an id, or meta.id = 123 (number). typeof implementation.meta.id !== 'string' is true, so validation.js:92 throws (auditName defaults to path or 'Unknown audit').","commonSituations":"Forgetting id in the meta getter. Using a numeric id. meta defined as a plain object literal missing the id key. Copy-paste leaving id from a template.","solutions":["Set a string id in meta: static get meta() { return {id: 'my-audit', ...}; }.","Use a unique, kebab-case id that matches what categories reference.","Ensure meta is defined (not undefined) before meta.id is read."],"exampleFix":"// before\nclass MyAudit extends Audit {\n  static get meta() { return {id: 5, title:'X', description:'Y', requiredArtifacts:[]}; }\n  static audit() {...}\n}\n// after\nclass MyAudit extends Audit {\n  static get meta() { return {id: 'my-audit', title:'X', description:'Y', requiredArtifacts:[]}; }\n  static audit() {...}\n}","handlingStrategy":"validation","validationCode":"function assertAuditMetaId(impl) {\n  if (typeof impl.meta?.id !== 'string') {\n    throw new TypeError(`Audit meta.id must be a string`);\n  }\n}","typeGuard":"function auditHasStringId(impl) {\n  return typeof impl === 'function' && typeof impl.meta?.id === 'string';\n}","tryCatchPattern":"try { new Config(config, {configPath}); }\ncatch (e) { if (/has no meta.id property/.test(e.message)) console.error('Add a string meta.id to the audit'); throw e; }","preventionTips":["Always include id in the audit's meta (a unique kebab-case string).","Ensure meta is defined before referencing meta.id.","Verify meta.id matches the id used in category auditRefs."],"tags":["config","lighthouse","audit","validation"],"backgroundTag":null,"analyzedSha":"9515cd4e58ebed69f78742d932b501c2cab8ad8f","analyzedAt":"2026-08-13T06:28:10.346Z","schemaVersion":2},"datasetVersion":"2026-08-13T09:17:06.757Z"}