{"record":{"id":"e45b46281012c985","repo":"Meituan-Dianping/mpvue","slug":"templates-should-only-be-responsible-for-mapping-t-e45b46","errorCode":null,"errorMessage":"Templates should only be responsible for mapping the state to the UI. Avoid placing tags with side-effects in your templates, such as <${tag}>, as they will not be parsed.","messagePattern":"Templates should only be responsible for mapping the state to the UI\\. Avoid placing tags with side-effects in your templates, such as <(.+?)>, as they will not be parsed\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/compiler/parser/index.js","lineNumber":119,"sourceCode":"      if (isIE && ns === 'svg') {\n        attrs = guardIESVGBug(attrs)\n      }\n\n      const element: ASTElement = {\n        type: 1,\n        tag,\n        attrsList: attrs,\n        attrsMap: makeAttrsMap(attrs),\n        parent: currentParent,\n        children: []\n      }\n      if (ns) {\n        element.ns = ns\n      }\n\n      if (isForbiddenTag(element) && !isServerRendering()) {\n        element.forbidden = true\n        process.env.NODE_ENV !== 'production' && warn(\n          'Templates should only be responsible for mapping the state to the ' +\n          'UI. Avoid placing tags with side-effects in your templates, such as ' +\n          `<${tag}>` + ', as they will not be parsed.'\n        )\n      }\n\n      // apply pre-transforms\n      for (let i = 0; i < preTransforms.length; i++) {\n        preTransforms[i](element, options)\n      }\n\n      if (!inVPre) {\n        processPre(element)\n        if (element.pre) {\n          inVPre = true\n        }\n      }\n      if (platformIsPreTag(element.tag)) {","sourceCodeStart":101,"sourceCodeEnd":137,"githubUrl":"https://github.com/Meituan-Dianping/mpvue/blob/6c5d78ee04f58c6d782c456dfcf0fe63c0b7f89b/src/compiler/parser/index.js#L101-L137","documentation":"Error \"Templates should only be responsible for mapping the state to the UI. Avoid placing tags with side-effects in your templates, such as <${tag}>, as they will not be parsed.\" thrown in Meituan-Dianping/mpvue.","triggerScenarios":"Thrown at src/compiler/parser/index.js:119 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Move side-effectful tags (<script>, <style> in restricted contexts) out of the template into the page or build pipeline","Use components/lifecycle hooks to trigger effects instead of template tags"],"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"}