{"record":{"id":"d442db57e3e323d6","repo":"dianping/cat","slug":"expected-end-of-value-but-found","errorCode":null,"errorMessage":"Expected end of value but found '{}'.","messagePattern":"Expected end of value but found '(.+?)'\\.","errorType":"validation","errorClass":"ValidationError","httpStatus":null,"severity":"error","filePath":"cat-home/src/main/webapp/assets/js/editor/worker-css.js","lineNumber":3671,"sourceCode":"        while (expression.hasNext() && count < max) {\n            valid = ValidationTypes.isAny(expression, numeric);\n            if (!valid) {\n                break;\n            }\n            count++;\n        }\n\n\n        if (!fill) {\n            ValidationTypes.isAny(expression, \"fill\");\n        } else {\n            valid = true;\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 ([<number> | <percentage>]{1,4} && fill?) but found '\" + part + \"'.\", part.line, part.col);\n            }\n        }\n    },\n    \"border-image-source\"           : \"<image> | none\",\n    \"border-image-width\"            : { multi: \"<length> | <percentage> | <number> | auto\", max: 4 },\n    \"border-left\"                   : \"<border-width> || <border-style> || <color>\",\n    \"border-left-color\"             : \"<color> | inherit\",\n    \"border-left-style\"             : \"<border-style>\",\n    \"border-left-width\"             : \"<border-width>\",\n    \"border-radius\"                 : function(expression) {\n\n        var valid   = false,\n            simple = \"<length> | <percentage> | inherit\",\n            slash   = false,\n            fill    = false,\n            count   = 0,","sourceCodeStart":3653,"sourceCodeEnd":3689,"githubUrl":"https://github.com/dianping/cat/blob/e815e74d4c2dd74edac831241f1253fcc7d25381/cat-home/src/main/webapp/assets/js/editor/worker-css.js#L3653-L3689","documentation":"A ValidationError from the custom validator for `border-image-slice` (grammar `[<number> | <percentage>]{1,4} && fill?`). The validator consumed a valid slice expression (up to four numbers/percentages, optionally the `fill` keyword) but the value expression still holds tokens — i.e. there is a fifth value, a second `fill`, or junk after a complete slice list.","triggerScenarios":"`border-image-slice: 1 2 3 4 5` (five values), `border-image-slice: 10% fill fill`, `border-image-slice: 30 / 30` (the `/` belongs to the border-image shorthand, not the longhand).","commonSituations":"Splitting a `border-image` shorthand into longhands incorrectly — the slash-separated segments (slice / width / outset) pasted wholesale into `border-image-slice`; copying MDN shorthand examples into longhand form.","solutions":["Keep at most 4 numbers/percentages and at most one `fill`: `border-image-slice: 10 20 30 40 fill;`.","If you pasted a shorthand, split it: slice, width, outset each go to their own longhand without the `/` separators.","Remove duplicated `fill` keywords."],"exampleFix":"/* before */\n.btn { border-image-slice: 30 / 30; } /* Expected end of value but found '/' */\n\n/* after */\n.btn { border-image-slice: 30; border-image-width: 30; }","handlingStrategy":"try-catch","validationCode":"function sliceOk(v) {\n  var parts = v.trim().split(/\\s+/);\n  if (parts.length > 5) return false;\n  return parts.every(function (p, i) { return p === 'fill' || /^\\d+(\\.\\d+)?%?$/.test(p); })\n    && parts.filter(function (p) { return p === 'fill'; }).length <= 1\n    && !/\\//.test(v);\n}","typeGuard":null,"tryCatchPattern":"try {\n  Validation.validate('border-image-slice', value);\n} catch (ex) {\n  if (ex instanceof ValidationError) { addLint(ex.line, ex.col, ex.message); return; }\n  throw ex;\n}","preventionTips":["Keep the border-image shorthand's slash segments in separate longhands.","Remember border-image-slice takes unitless numbers/percentages only — no px, no `/`."],"tags":["css","validation","border-image","property-value"],"backgroundTag":null,"analyzedSha":"e815e74d4c2dd74edac831241f1253fcc7d25381","analyzedAt":"2026-08-14T14:22:34.512Z","schemaVersion":2},"datasetVersion":"2026-08-15T17:31:12.345Z"}