{"record":{"id":"0c6d44a0254c0cbe","repo":"Meituan-Dianping/mpvue","slug":"duplicate-attribute-attrs-i-name","errorCode":null,"errorMessage":"duplicate attribute: ${attrs[i].name}","messagePattern":"duplicate attribute: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/weex-template-compiler/build.js","lineNumber":1866,"sourceCode":"}\n\nfunction parseModifiers (name) {\n  var match = name.match(modifierRE);\n  if (match) {\n    var ret = {};\n    match.forEach(function (m) { ret[m.slice(1)] = true; });\n    return ret\n  }\n}\n\nfunction makeAttrsMap (attrs) {\n  var map = {};\n  for (var i = 0, l = attrs.length; i < l; i++) {\n    if (\n      process.env.NODE_ENV !== 'production' &&\n      map[attrs[i].name] && !isIE && !isEdge\n    ) {\n      warn('duplicate attribute: ' + attrs[i].name);\n    }\n    map[attrs[i].name] = attrs[i].value;\n  }\n  return map\n}\n\n// for script (e.g. type=\"x/template\") or style, do not decode content\nfunction isTextTag (el) {\n  return el.tag === 'script' || el.tag === 'style'\n}\n\nfunction isForbiddenTag (el) {\n  return (\n    el.tag === 'style' ||\n    (el.tag === 'script' && (\n      !el.attrsMap.type ||\n      el.attrsMap.type === 'text/javascript'\n    ))","sourceCodeStart":1848,"sourceCodeEnd":1884,"githubUrl":"https://github.com/Meituan-Dianping/mpvue/blob/6c5d78ee04f58c6d782c456dfcf0fe63c0b7f89b/packages/weex-template-compiler/build.js#L1848-L1884","documentation":"Dev-only compiler warning from makeAttrsMap while building the attribute map during template parsing: the same attribute name appears more than once on one element. Later duplicates silently overwrite earlier ones, so the warning flags a template that likely does not do what the author intended.","triggerScenarios":"Thrown at packages/weex-template-compiler/build.js:1866 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove the duplicate attribute so each name appears once on the element","Merge intended values (e.g. combine class lists) into a single attribute","Note: duplicates caused by IE/Edge parsing quirks are exempted in the check"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6c5d78ee04f58c6d782c456dfcf0fe63c0b7f89b","analyzedAt":"2026-09-02T05:17:40.946Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-09T11:17:12.671Z"}