microsoft/playwright · error · Error
"${attr.name}" must be one of ${values.map(v => JSON.stringi
Error message
"${attr.name}" must be one of ${values.map(v => JSON.stringify(v)).join(', ')} What it means
Error ""${attr.name}" must be one of ${values.map(v => JSON.stringify(v)).join(', ')}" thrown in microsoft/playwright.
Source
Thrown at packages/injected/src/roleSelectorEngine.ts:53
pressed?: boolean | 'mixed';
selected?: boolean;
expanded?: boolean;
level?: number;
disabled?: boolean;
includeHidden?: boolean;
};
const kSupportedAttributes = ['selected', 'checked', 'pressed', 'expanded', 'level', 'disabled', 'name', 'description', 'include-hidden'];
kSupportedAttributes.sort();
function validateSupportedRole(attr: string, roles: string[], role: string) {
if (!roles.includes(role))
throw new Error(`"${attr}" attribute is only supported for roles: ${roles.slice().sort().map(role => `"${role}"`).join(', ')}`);
}
function validateSupportedValues(attr: AttributeSelectorPart, values: any[]) {
if (attr.op !== '<truthy>' && !values.includes(attr.value))
throw new Error(`"${attr.name}" must be one of ${values.map(v => JSON.stringify(v)).join(', ')}`);
}
function validateSupportedOp(attr: AttributeSelectorPart, ops: AttributeSelectorOperator[]) {
if (!ops.includes(attr.op))
throw new Error(`"${attr.name}" does not support "${attr.op}" matcher`);
}
function validateAttributes(attrs: AttributeSelectorPart[], role: string): RoleEngineOptions {
const options: RoleEngineOptions = { role };
for (const attr of attrs) {
switch (attr.name) {
case 'checked': {
validateSupportedRole(attr.name, kAriaCheckedRoles, role);
validateSupportedValues(attr, [true, false, 'mixed']);
validateSupportedOp(attr, ['<truthy>', '=']);
options.checked = attr.op === '<truthy>' ? true : attr.value;
break;
}View on GitHub (pinned to c8fc3bf8d3)
When it happens
Trigger: Thrown at packages/injected/src/roleSelectorEngine.ts:53 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of microsoft/playwright@c8fc3bf8d3 (2026-08-12).
Data as JSON: /api/errors/6edc82f5a87a08b6.
Report an issue: GitHub.