dianping/cat · error · ValidationError

Expected end of value but found '{part}'.

Error message

Expected end of value but found '{part}'.

What it means

A CSSLint-style ValidationError raised by the custom validator for the `azimuth` property (a legacy CSS2 aural property kept in the validator table). The validator matched a valid azimuth expression but the value expression still has tokens left over, meaning the declaration contains more than one value where only one (optionally compound) azimuth is allowed. It carries the offending part's line/col.

Source

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

        if (!ValidationTypes.isAny(expression, simple)) {
            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,

View on GitHub (pinned to e815e74d4c)

Solutions

  1. Reduce the value to a single valid azimuth: one angle (`45deg`), one positional keyword (`left-side`, `behind`, `center`), or `behind` + one keyword/angle as the grammar allows.
  2. If this property is meaningless in your project (it is obsolete/aural), delete the declaration entirely.
  3. If a compound aural effect was intended, verify against the CSS2 grammar and drop the extra token the message names.
  4. Remove the `azimuth` entry from your linter's property table if you must keep the declarations unvalidated.

Example fix

/* before */
.voice { azimuth: behind 45deg behind; } /* Expected end of value but found 'behind' */

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

Strategy: try-catch

Validate before calling

// azimuth is single-valued; reject declarations with >2 tokens before validating
function prevalidateAzimuth(decl) {
  if (decl.property === 'azimuth' && decl.value.split(/\s+/).length > 2) return 'too many values for azimuth';
  return null;
}

Try / catch

try {
  Validation.validate(property, value);
} catch (ex) {
  if (ex instanceof ValidationError || /end of value/.test(ex.message)) { addLint(ex.line, ex.col, ex.message); continue; }
  throw ex;
}

Prevention

When it happens

Trigger: Declarations like `azimuth: behind 45deg behind`, `azimuth: left-side extra`, `azimuth: 30deg 40deg` — the first tokens parse as a valid azimuth, then `expression.hasNext()` is still true and the leftover part is reported.

Common situations: Copy-pasted aural CSS from ancient templates; property name intended to be different (`azimuth` used where `transform: rotate()` was meant); LLM/autocompleted CSS adding junk after a valid value.

Related errors


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