{"record":{"id":"6f04fa4418794d2f","repo":"microsoft/playwright","slug":"description-attribute-must-be-a-string-or-a-regu","errorCode":null,"errorMessage":"\"description\" attribute must be a string or a regular expression","messagePattern":"\"description\" attribute must be a string or a regular expression","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/injected/src/roleSelectorEngine.ts","lineNumber":123,"sourceCode":"        validateSupportedOp(attr, ['<truthy>', '=']);\n        options.disabled = attr.op === '<truthy>' ? true : attr.value;\n        break;\n      }\n      case 'name': {\n        if (attr.op === '<truthy>')\n          throw new Error(`\"name\" attribute must have a value`);\n        if (typeof attr.value !== 'string' && !(attr.value instanceof RegExp))\n          throw new Error(`\"name\" attribute must be a string or a regular expression`);\n        options.name = attr.value;\n        options.nameOp = attr.op;\n        options.nameExact = attr.caseSensitive;\n        break;\n      }\n      case 'description': {\n        if (attr.op === '<truthy>')\n          throw new Error(`\"description\" attribute must have a value`);\n        if (typeof attr.value !== 'string' && !(attr.value instanceof RegExp))\n          throw new Error(`\"description\" attribute must be a string or a regular expression`);\n        options.description = attr.value;\n        options.descriptionOp = attr.op;\n        options.descriptionExact = attr.caseSensitive;\n        break;\n      }\n      case 'include-hidden': {\n        validateSupportedValues(attr, [true, false]);\n        validateSupportedOp(attr, ['<truthy>', '=']);\n        options.includeHidden = attr.op === '<truthy>' ? true : attr.value;\n        break;\n      }\n      default: {\n        throw new Error(`Unknown attribute \"${attr.name}\", must be one of ${kSupportedAttributes.map(a => `\"${a}\"`).join(', ')}.`);\n      }\n    }\n  }\n  return options;\n}","sourceCodeStart":105,"sourceCodeEnd":141,"githubUrl":"https://github.com/microsoft/playwright/blob/c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6/packages/injected/src/roleSelectorEngine.ts#L105-L141","documentation":"Error \"\"description\" attribute must be a string or a regular expression\" thrown in microsoft/playwright.","triggerScenarios":"Thrown at packages/injected/src/roleSelectorEngine.ts:123 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"c8fc3bf8d31542d59b4d4d9eaab1df93ff541dc6","analyzedAt":"2026-08-12T07:26:36.950Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}