dianping/cat · error · Error

attribute value missed!!

Error message

attribute value missed!!

What it means

The attribute tokenizer reached the end of the start tag ('>' path) while still in state S_EQ (worker-xml.js:~1589): an attribute name and '=' were consumed but no value followed before the tag closed. Since there is nothing to attach, the parser throws this hard error rather than silently inventing a value.

Source

Thrown at cat-home/src/main/webapp/assets/js/editor/worker-xml.js:1589

				value = source.slice(start,p);
				if(value.slice(-1) === '/'){
					el.closed  = true;
					value = value.slice(0,-1)
				}
			case S_ATTR_S:
				if(s === S_ATTR_S){
					value = attrName;
				}
				if(s == S_V){
					errorHandler.warning('attribute "'+value+'" missed quot(")!!');
					el.add(attrName,value.replace(/&#?\w+;/g,entityReplacer),start)
				}else{
					errorHandler.warning('attribute "'+value+'" missed value!! "'+value+'" instead!!')
					el.add(value,value,start)
				}
				break;
			case S_EQ:
				throw new Error('attribute value missed!!');
			}
			return p;
		case '\u0080':
			c = ' ';
		default:
			if(c<= ' '){//space
				switch(s){
				case S_TAG:
					el.setTagName(source.slice(start,p));//tagName
					s = S_S;
					break;
				case S_ATTR:
					attrName = source.slice(start,p)
					s = S_ATTR_S;
					break;
				case S_V:
					var value = source.slice(start,p).replace(/&#?\w+;/g,entityReplacer);
					errorHandler.warning('attribute "'+value+'" missed quot(")!!');

View on GitHub (pinned to e815e74d4c)

Solutions

  1. Supply a value after '=' or remove both '=' and the attribute: <tag disabled="disabled"> or <tag>.
  2. For boolean-ish attributes in XML, use a name="name" pair or move to a schema that defines defaults.
  3. If ${}-style placeholders are intentional, parse with a mode that supports the template language, not the plain XML worker.

Example fix

<!-- before -->
<button disabled=>OK</button>

<!-- after -->
<button disabled="disabled">OK</button>
Defensive patterns

Strategy: validation

Validate before calling

// Every '=' inside a start tag must be followed by a value:
function equalsHaveValues(tagText) {
  return !/=\s*(>|$)/.test(tagText);
}

Try / catch

try {
  parseStartTag(source, start, tagNameReplacer);
} catch (ex) {
  if (/attribute value missed/.test(ex.message)) reportXmlError(ex); else throw ex;
}

Prevention

When it happens

Trigger: '<tag disabled=>' — equals sign immediately followed by '>'. Also '<tag a= b>' is tolerated as unquoted value 'b', but 'a= >' hits the S_EQ case at line 1587-1589. Common while typing.

Common situations: Mid-edit XML in the editor (typed '=' but not yet the value), HTML boolean-attribute habits ('disabled=') pasted into XML, templating placeholders like '<x v=${}>'.

Related errors


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