{"record":{"id":"3eabee9c16ab2849","repo":"amruthpillai/reactive-resume","slug":"unsupported-selector-node-node-type","errorCode":null,"errorMessage":"Unsupported selector node ${node.type}.","messagePattern":"Unsupported selector node (.+?)\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/resume/src/stylesheet/selector.ts","lineNumber":233,"sourceCode":"\t\t\t\t\tthrow new Error(`:${name} requires a selector list.`);\n\t\t\t\t}\n\t\t\t\tconst selectors = compileSelectorList(nested[0], { depth: context.depth + 1 });\n\t\t\t\treturn { type: \"pseudo\", name: name as \"is\" | \"where\" | \"not\", selectors };\n\t\t\t}\n\t\t\tif (name === \"nth-child\" || name === \"nth-of-type\") {\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}\n\t\t\t\treturn compileNth(node, name, context);\n\t\t\t}\n\t\t\tthrow new Error(`Unsupported pseudo-class :${name}.`);\n\t\t}\n\t\tcase \"ClassSelector\":\n\t\t\tthrow new Error(\"Custom class selectors are not supported.\");\n\t\tcase \"PseudoElementSelector\":\n\t\t\tthrow new Error(\"Pseudo-elements are not supported.\");\n\t\tdefault:\n\t\t\tthrow new Error(`Unsupported selector node ${node.type}.`);\n\t}\n}\n\nfunction compileComplex(node: SelectorAst, context: CompileContext): CompiledComplexSelector {\n\tif (node.type !== \"Selector\") throw new Error(\"Expected a Selector AST.\");\n\n\tconst compounds: CompiledCompoundSelector[] = [];\n\tconst combinators: Combinator[] = [];\n\tlet selectors: CompiledSimpleSelector[] = [];\n\tfor (const child of childrenOf(node)) {\n\t\tif (child.type === \"Combinator\") {\n\t\t\tconst name = astName(child) as Combinator;\n\t\t\tif (![\" \", \">\", \"+\", \"~\"].includes(name) || selectors.length === 0) {\n\t\t\t\tthrow new Error(\"Unsupported or misplaced combinator.\");\n\t\t\t}\n\t\t\tvalidateCompound(selectors);\n\t\t\tcompounds.push({ selectors });\n\t\t\tselectors = [];","sourceCodeStart":215,"sourceCodeEnd":251,"githubUrl":"https://github.com/amruthpillai/reactive-resume/blob/3a5b12e2a40374a9571988701fcb75c5a1831c42/packages/resume/src/stylesheet/selector.ts#L215-L251","documentation":"Thrown by compileSimple in the default switch branch when the AST node type is none of TypeSelector, IdSelector, AttributeSelector, PseudoClassSelector, ClassSelector, or PseudoElementSelector. It is the defensive catch-all for unexpected css-tree node shapes inside a compound selector.","triggerScenarios":"A css-tree version emitting a new selector node type, or a hand-constructed/transformed AST containing an unexpected node as a child of a Selector.","commonSituations":"Upgrading css-tree without re-testing; passing programmatically built CssNode objects; namespace selectors like svg|section that css-tree parses into a node type this compiler does not handle.","solutions":["Pass a plain selector string so css-tree emits only the supported node types.","Remove namespace or other exotic selector syntax (e.g. svg|section).","Pin and test against the css-tree version declared by @reactive-resume/resume."],"exampleFix":"// before\nsvg|section\n// after\nsection","handlingStrategy":"try-catch","validationCode":"import { compileSelector } from '@reactive-resume/resume';\n\nconst isSupportedShape = (source) => compileSelector(source).selector !== null;\n// prefer passing a string so css-tree emits only the node types compileSimple handles","typeGuard":"const isRejected = (r) => r.selector === null && typeof r.error === 'string';","tryCatchPattern":"const result = compileSelector(astOrString);\nif (result.selector === null && result.error.startsWith('Unsupported selector node ')) {\n  removeNamespaceOrExoticSyntax();\n}","preventionTips":["Pass selector strings, not hand-built AST, to avoid unexpected node types.","Remove namespace selectors (svg|section) and other exotic syntax.","Pin and regression-test the css-tree version."],"tags":["semantic-css","selector","ast","defensive"],"backgroundTag":null,"analyzedSha":"3a5b12e2a40374a9571988701fcb75c5a1831c42","analyzedAt":"2026-08-12T22:31:22.666Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}