{"record":{"id":"8283174d888dcf4c","repo":"amruthpillai/reactive-resume","slug":"unknown-semantic-element-name","errorCode":null,"errorMessage":"Unknown semantic element ${name}.","messagePattern":"Unknown semantic element (.+?)\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/resume/src/stylesheet/selector.ts","lineNumber":183,"sourceCode":"\t} else if (expression.type === \"AnPlusB\") {\n\t\ta = expression.a === null || expression.a === undefined ? 0 : Number(expression.a);\n\t\tb = expression.b === null || expression.b === undefined ? 0 : Number(expression.b);\n\t\tif (!Number.isInteger(a) || !Number.isInteger(b)) throw new Error(`Invalid :${name} expression.`);\n\t} else {\n\t\tthrow new Error(`Unsupported :${name} expression.`);\n\t}\n\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}","sourceCodeStart":165,"sourceCodeEnd":201,"githubUrl":"https://github.com/amruthpillai/reactive-resume/blob/3a5b12e2a40374a9571988701fcb75c5a1831c42/packages/resume/src/stylesheet/selector.ts#L165-L201","documentation":"Thrown by compileSimple in the TypeSelector branch when the type name is not in the SEMANTIC_NODE_KINDS list (and is not the universal '*'). Only registered semantic element kinds like resume, page, section, item, etc. are valid type selectors.","triggerScenarios":"Writing div, span, unknown-element, or any HTML tag name that is not a registered semantic kind.","commonSituations":"Copying HTML tag selectors into resume semantic CSS; renaming a kind in the schema without updating CSS; using a kind from a different resume schema version.","solutions":["Replace the type with one from SEMANTIC_NODE_KINDS (resume, page, region, header, section, item, field, link, etc.).","Use the universal selector '*' if you genuinely mean any element.","Consult the SEMANTIC_NODE_KINDS export for the exhaustive list."],"exampleFix":"// before\ndiv > section\n// after\nregion > section","handlingStrategy":"validation","validationCode":"import { SEMANTIC_NODE_KINDS } from '@reactive-resume/resume';\n\nconst KNOWN = new Set(SEMANTIC_NODE_KINDS);\nconst typeIsKnown = (name) => name === '*' || KNOWN.has(name);\n// check each type selector token 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 element ')) {\n  suggestRegisteredKind(selector);\n}","preventionTips":["Use SEMANTIC_NODE_KINDS as the closed vocabulary for type selectors.","Do not port HTML tag names into semantic CSS.","After schema renames, sweep CSS for stale type names."],"tags":["semantic-css","selector","type","validation"],"backgroundTag":null,"analyzedSha":"3a5b12e2a40374a9571988701fcb75c5a1831c42","analyzedAt":"2026-08-12T22:31:22.666Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}