{"record":{"id":"1aa4436f69514f45","repo":"amruthpillai/reactive-resume","slug":"unknown-semantic-attribute-name","errorCode":null,"errorMessage":"Unknown semantic attribute ${name}.","messagePattern":"Unknown semantic attribute (.+?)\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/resume/src/stylesheet/selector.ts","lineNumber":190,"sourceCode":"\n\tif (name === \"nth-of-type\" && nth[0].selector) throw new Error(\":nth-of-type does not accept an of selector.\");\n\tconst of = nth[0].selector ? compileSelectorList(nth[0].selector, { depth: context.depth + 1 }) : undefined;\n\treturn { type: \"pseudo\", name, a, b, ...(of ? { of } : {}) };\n}\n\nfunction compileSimple(node: SelectorAst, context: CompileContext): CompiledSimpleSelector | null {\n\tswitch (node.type) {\n\t\tcase \"TypeSelector\": {\n\t\t\tconst name = astName(node);\n\t\t\tif (name === \"*\") return { type: \"universal\" };\n\t\t\tif (!knownKinds.has(name)) throw new Error(`Unknown semantic element ${name}.`);\n\t\t\treturn { type: \"type\", name: name as SemanticNode[\"kind\"] };\n\t\t}\n\t\tcase \"IdSelector\":\n\t\t\treturn { type: \"id\", value: astName(node) };\n\t\tcase \"AttributeSelector\": {\n\t\t\tconst name = astName(node);\n\t\t\tif (!knownAttributes.has(name)) throw new Error(`Unknown semantic attribute ${name}.`);\n\t\t\tif (node.flags) throw new Error(\"Attribute selector flags are not supported.\");\n\t\t\tconst matcher = node.matcher as AttributeMatcher | null | undefined;\n\t\t\tif (matcher !== null && matcher !== undefined && ![\"=\", \"~=\", \"|=\", \"^=\", \"$=\", \"*=\"].includes(matcher)) {\n\t\t\t\tthrow new Error(`Unsupported attribute matcher ${matcher}.`);\n\t\t\t}\n\t\t\tconst value = attributeValue(node);\n\t\t\tif ((matcher === null || matcher === undefined) !== (value === null)) {\n\t\t\t\tthrow new Error(\"Attribute selector matcher and value must be used together.\");\n\t\t\t}\n\t\t\treturn { type: \"attribute\", name, matcher: matcher ?? null, value };\n\t\t}\n\t\tcase \"PseudoClassSelector\": {\n\t\t\tconst name = astName(node);\n\t\t\tif ([\"root\", \"first-child\", \"last-child\", \"only-child\"].includes(name)) {\n\t\t\t\tif (node.children !== null && node.children !== undefined)\n\t\t\t\t\tthrow new Error(`:${name} does not accept arguments.`);\n\t\t\t\treturn { type: \"pseudo\", name: name as \"root\" | \"first-child\" | \"last-child\" | \"only-child\" };\n\t\t\t}","sourceCodeStart":172,"sourceCodeEnd":208,"githubUrl":"https://github.com/amruthpillai/reactive-resume/blob/3a5b12e2a40374a9571988701fcb75c5a1831c42/packages/resume/src/stylesheet/selector.ts#L172-L208","documentation":"Thrown by compileSimple in the AttributeSelector branch when the attribute name is not in the knownAttributes set (the union of 'id', 'role', and every attributes array across SEMANTIC_REGISTRY_V1). Matching is case-sensitive, so [TYPE] is rejected even if [type] is valid.","triggerScenarios":"Writing [unknown], [TYPE], [data-x], or any attribute not declared anywhere in the registry.","commonSituations":"Using HTML data-* attributes; uppercase attribute names; typos; attributes from a newer/older schema version.","solutions":["Use a lowercase attribute name that appears in the registry (id, role, type, placement, region, part, page-number, level, direction, name, owner, origin, template).","For custom targeting, use [id='...'] or a structural selector instead of an unregistered attribute.","Check spelling and case against the SEMANTIC_REGISTRY_V1 export."],"exampleFix":"// before\n[TYPE='experience']\n// after\n[type='experience']","handlingStrategy":"validation","validationCode":"import { SEMANTIC_REGISTRY_V1 } from '@reactive-resume/resume';\n\nconst KNOWN_ATTRS = new Set(['id', 'role', ...Object.values(SEMANTIC_REGISTRY_V1).flatMap(d => d.attributes)]);\nconst attributeIsKnown = (name) => KNOWN_ATTRS.has(name.toLowerCase()) && KNOWN_ATTRS.has(name); // case-sensitive\n// verify attribute names (case-sensitive) before compiling","typeGuard":"const isRejected = (r) => r.selector === null && typeof r.error === 'string';","tryCatchPattern":"const result = compileSelector(selector);\nif (result.selector === null && result.error.startsWith('Unknown semantic attribute ')) {\n  lowerCaseOrSuggestAttribute(selector);\n}","preventionTips":["Attribute names are case-sensitive; always use lowercase.","Avoid data-* attributes; they are not in the registry.","Source attribute names from SEMANTIC_REGISTRY_V1."],"tags":["semantic-css","selector","attribute","case-sensitive","validation"],"backgroundTag":null,"analyzedSha":"3a5b12e2a40374a9571988701fcb75c5a1831c42","analyzedAt":"2026-08-12T22:31:22.666Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}