{"record":{"id":"96e3812fd5df40ca","repo":"amruthpillai/reactive-resume","slug":"name-requires-a-selector-list","errorCode":null,"errorMessage":":${name} requires a selector list.","messagePattern":":(.+?) requires a selector list\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/resume/src/stylesheet/selector.ts","lineNumber":215,"sourceCode":"\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}\n\t\t\t\tconst nested = childrenOf(node);\n\t\t\t\tif (nested.length !== 1 || nested[0]?.type !== \"SelectorList\") {\n\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}.`);","sourceCodeStart":197,"sourceCodeEnd":233,"githubUrl":"https://github.com/amruthpillai/reactive-resume/blob/3a5b12e2a40374a9571988701fcb75c5a1831c42/packages/resume/src/stylesheet/selector.ts#L197-L233","documentation":"Thrown by compileSimple for :is, :where, or :not when the pseudo-class's children are not exactly one SelectorList node. These functional pseudo-classes require a single comma-separated selector list as their argument.","triggerScenarios":"A programmatically built AST whose children are not a single SelectorList; malformed :is() with empty or wrong-structured children; css-tree edge cases producing non-SelectorList children.","commonSituations":"Hand-constructing CssNode objects; transforming ASTs without preserving the SelectorList wrapper; partial parses.","solutions":["Author the selector as a string: :is(section, item) so css-tree builds the correct SelectorList.","If building AST manually, wrap the argument list in a SelectorList node with the Selector children.","Ensure at least one selector is present inside the function."],"exampleFix":"// before\n// AST: PseudoClassSelector{name:'is', children:[Selector, Selector]}\n// after\n:is(section, item)","handlingStrategy":"try-catch","validationCode":"import { compileSelector } from '@reactive-resume/resume';\n\nconst isValid = (source) => compileSelector(source).selector !== null;\n// for :is/:where/:not, prefer passing a string so css-tree wraps args in a SelectorList","typeGuard":"const isRejected = (r) => r.selector === null && typeof r.error === 'string';","tryCatchPattern":"const result = compileSelector(astOrString);\nif (result.selector === null && result.error.endsWith(' requires a selector list.')) {\n  rewriteAsSelectorListArgument();\n}","preventionTips":["Always include at least one selector inside :is/:where/:not.","When building AST, wrap arguments in a SelectorList node.","Author these pseudo-classes as strings to let css-tree build the correct shape."],"tags":["semantic-css","selector","pseudo-class","ast"],"backgroundTag":null,"analyzedSha":"3a5b12e2a40374a9571988701fcb75c5a1831c42","analyzedAt":"2026-08-12T22:31:22.666Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}