{"record":{"id":"432b8f43340d89dc","repo":"amruthpillai/reactive-resume","slug":"unsupported-attribute-matcher-matcher","errorCode":null,"errorMessage":"Unsupported attribute matcher ${matcher}.","messagePattern":"Unsupported attribute matcher (.+?)\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/resume/src/stylesheet/selector.ts","lineNumber":194,"sourceCode":"}\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}\n\t\t\tif ([\"is\", \"where\", \"not\"].includes(name)) {\n\t\t\t\tif (context.depth >= SEMANTIC_CSS_LIMITS_V1.maxFunctionDepth) {\n\t\t\t\t\tthrow new Error(\"Selector function nesting is too deep.\");\n\t\t\t\t}","sourceCodeStart":176,"sourceCodeEnd":212,"githubUrl":"https://github.com/amruthpillai/reactive-resume/blob/3a5b12e2a40374a9571988701fcb75c5a1831c42/packages/resume/src/stylesheet/selector.ts#L176-L212","documentation":"Thrown by compileSimple in the AttributeSelector branch when node.matcher is present but is not one of the six supported CSS matchers '=', '~=', '|=', '^=', '$=', '*='. Any other matcher token is rejected.","triggerScenarios":"A programmatically built AST carrying an unsupported matcher string, or a css-tree version that emits a matcher token this compiler does not whitelist.","commonSituations":"Feeding a hand-constructed CssNode to compileSelector; upgrading css-tree; exotic/non-standard matcher syntax.","solutions":["Use one of the six standard matchers: =, ~=, |=, ^=, $=, *=.","Pass a selector string instead of a custom AST so css-tree only emits standard matchers.","For presence tests, omit the matcher entirely: [type]."],"exampleFix":"// before\n// (custom AST with matcher '~=i')\n// after\n[type~='experience']","handlingStrategy":"validation","validationCode":"const MATCHERS = new Set(['=', '~=', '|=', '^=', '$=', '*=']);\nconst matcherIsSupported = (m) => m === null || m === undefined || MATCHERS.has(m);\n// verify any matcher before building an attribute selector AST","typeGuard":"const isRejected = (r) => r.selector === null && typeof r.error === 'string';","tryCatchPattern":"const result = compileSelector(selectorOrAst);\nif (result.selector === null && result.error.startsWith('Unsupported attribute matcher ')) {\n  rewriteToStandardMatcher();\n}","preventionTips":["Use only the six standard CSS attribute matchers.","Pass selector strings rather than custom AST to avoid non-standard matcher tokens.","For presence tests, omit the matcher entirely."],"tags":["semantic-css","selector","attribute","matcher","ast"],"backgroundTag":null,"analyzedSha":"3a5b12e2a40374a9571988701fcb75c5a1831c42","analyzedAt":"2026-08-12T22:31:22.666Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}