{"record":{"id":"1723779eaedd14ed","repo":"dianping/cat","slug":"expected-azimuth-but-found","errorCode":null,"errorMessage":"Expected (<'azimuth'>) but found '{}'.","messagePattern":"Expected \\(<'azimuth'>\\) but found '(.+?)'\\.","errorType":"validation","errorClass":"ValidationError","httpStatus":null,"severity":"error","filePath":"cat-home/src/main/webapp/assets/js/editor/worker-css.js","lineNumber":3605,"sourceCode":"            if (ValidationTypes.isAny(expression, \"behind\")) {\n                behind = true;\n                valid = true;\n            }\n\n            if (ValidationTypes.isAny(expression, direction)) {\n                valid = true;\n                if (!behind) {\n                    ValidationTypes.isAny(expression, \"behind\");\n                }\n            }\n        }\n\n        if (expression.hasNext()) {\n            part = expression.next();\n            if (valid) {\n                throw new ValidationError(\"Expected end of value but found '\" + part + \"'.\", part.line, part.col);\n            } else {\n                throw new ValidationError(\"Expected (<'azimuth'>) but found '\" + part + \"'.\", part.line, part.col);\n            }\n        }\n    },\n    \"backface-visibility\"           : \"visible | hidden\",\n    \"background\"                    : 1,\n    \"background-attachment\"         : { multi: \"<attachment>\", comma: true },\n    \"background-clip\"               : { multi: \"<box>\", comma: true },\n    \"background-color\"              : \"<color> | inherit\",\n    \"background-image\"              : { multi: \"<bg-image>\", comma: true },\n    \"background-origin\"             : { multi: \"<box>\", comma: true },\n    \"background-position\"           : { multi: \"<bg-position>\", comma: true },\n    \"background-repeat\"             : { multi: \"<repeat-style>\" },\n    \"background-size\"               : { multi: \"<bg-size>\", comma: true },\n    \"baseline-shift\"                : \"baseline | sub | super | <percentage> | <length>\",\n    \"behavior\"                      : 1,\n    \"binding\"                       : 1,\n    \"bleed\"                         : \"<length>\",\n    \"bookmark-label\"                : \"<content> | <attr> | <string>\",","sourceCodeStart":3587,"sourceCodeEnd":3623,"githubUrl":"https://github.com/dianping/cat/blob/e815e74d4c2dd74edac831241f1253fcc7d25381/cat-home/src/main/webapp/assets/js/editor/worker-css.js#L3587-L3623","documentation":"The failure twin of the previous error: the custom `azimuth` validator could not match ANY valid azimuth from the expression (`valid === false`) and tokens remain, so it throws `ValidationError(\"Expected (<'azimuth'>) but found '{part}'\")` pointing at the first unmatched part. The value is not merely too long — it does not start with anything the azimuth grammar accepts.","triggerScenarios":"`azimuth: 45` (missing unit), `azimuth: behind-behind`, `azimuth: center-left-side` (compound keyword that doesn't exist), `azimuth: #fff` (a color where an angle/keyword belongs).","commonSituations":"Unit-less numbers pasted from JS; misremembered compound keywords; values intended for other properties pasted under `azimuth`; dead aural CSS nobody executes so the typo survives until a worker validates it.","solutions":["Replace the value with a valid one: an angle with unit (`90deg`, `-180deg`, `1.5rad`), a single positional keyword (`left`, `right`, `behind`, `center`, `left-side`, `right-side`, `far-left`, `far-right`, `leftwards`, `rightwards`), `behind` + keyword/angle, or `inherit`.","Delete the obsolete declaration if aural styling is not actually used.","Add unit-suffix checks to your editor/linter for angle values."],"exampleFix":"/* before */\n.voice { azimuth: 45; } /* Expected (<'azimuth'>) but found '45' */\n\n/* after */\n.voice { azimuth: 45deg; }","handlingStrategy":"try-catch","validationCode":"var AZ = /^(inherit|behind\\s+)?(left-side|far-left|left|center-left|center|center-right|right|far-right|right-side|behind|[+-]?\\d+(\\.\\d+)?(deg|grad|rad)|leftwards|rightwards)$/;\nfunction azimuthValueOk(v) { return AZ.test(v.trim()); }","typeGuard":null,"tryCatchPattern":"try {\n  Validation.validate('azimuth', value);\n} catch (ex) {\n  if (/azimuth/.test(ex.message)) { addLint(ex.line, ex.col, ex.message); return; }\n  throw ex;\n}","preventionTips":["Always unit angles (deg/grad/rad) — bare numbers fail this grammar.","Remove legacy aural CSS from templates so this class of error disappears.","Pre-validate against the message's own grammar string when generating CSS programmatically."],"tags":["css","validation","azimuth","property-value","legacy"],"backgroundTag":null,"analyzedSha":"e815e74d4c2dd74edac831241f1253fcc7d25381","analyzedAt":"2026-08-14T14:22:34.512Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}