dianping/cat · error · ValidationError

Expected (<'azimuth'>) but found '{}'.

Error message

Expected (<'azimuth'>) but found '{}'.

What it means

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.

Source

Thrown at cat-home/src/main/webapp/assets/js/editor/worker-css.js:3605

            if (ValidationTypes.isAny(expression, "behind")) {
                behind = true;
                valid = true;
            }

            if (ValidationTypes.isAny(expression, direction)) {
                valid = true;
                if (!behind) {
                    ValidationTypes.isAny(expression, "behind");
                }
            }
        }

        if (expression.hasNext()) {
            part = expression.next();
            if (valid) {
                throw new ValidationError("Expected end of value but found '" + part + "'.", part.line, part.col);
            } else {
                throw new ValidationError("Expected (<'azimuth'>) but found '" + part + "'.", part.line, part.col);
            }
        }
    },
    "backface-visibility"           : "visible | hidden",
    "background"                    : 1,
    "background-attachment"         : { multi: "<attachment>", comma: true },
    "background-clip"               : { multi: "<box>", comma: true },
    "background-color"              : "<color> | inherit",
    "background-image"              : { multi: "<bg-image>", comma: true },
    "background-origin"             : { multi: "<box>", comma: true },
    "background-position"           : { multi: "<bg-position>", comma: true },
    "background-repeat"             : { multi: "<repeat-style>" },
    "background-size"               : { multi: "<bg-size>", comma: true },
    "baseline-shift"                : "baseline | sub | super | <percentage> | <length>",
    "behavior"                      : 1,
    "binding"                       : 1,
    "bleed"                         : "<length>",
    "bookmark-label"                : "<content> | <attr> | <string>",

View on GitHub (pinned to e815e74d4c)

Solutions

  1. 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`.
  2. Delete the obsolete declaration if aural styling is not actually used.
  3. Add unit-suffix checks to your editor/linter for angle values.

Example fix

/* before */
.voice { azimuth: 45; } /* Expected (<'azimuth'>) but found '45' */

/* after */
.voice { azimuth: 45deg; }
Defensive patterns

Strategy: try-catch

Validate before calling

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)$/;
function azimuthValueOk(v) { return AZ.test(v.trim()); }

Try / catch

try {
  Validation.validate('azimuth', value);
} catch (ex) {
  if (/azimuth/.test(ex.message)) { addLint(ex.line, ex.col, ex.message); return; }
  throw ex;
}

Prevention

When it happens

Trigger: `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).

Common situations: 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.

Related errors


AI-assisted analysis of dianping/cat@e815e74d4c (2026-08-14). Data as JSON: /api/errors/1723779eaedd14ed. Report an issue: GitHub.