{"record":{"id":"954278254ec1181a","repo":"Meituan-Dianping/mpvue","slug":"do-not-use-built-in-or-reserved-html-elements-as-c","errorCode":null,"errorMessage":"Do not use built-in or reserved HTML elements as component id: ${id}","messagePattern":"Do not use built-in or reserved HTML elements as component id: (.+?)","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/core/global-api/assets.js","lineNumber":22,"sourceCode":"import { ASSET_TYPES } from 'shared/constants'\nimport { warn, isPlainObject } from '../util/index'\n\nexport function initAssetRegisters (Vue: GlobalAPI) {\n  /**\n   * Create asset registration methods.\n   */\n  ASSET_TYPES.forEach(type => {\n    Vue[type] = function (\n      id: string,\n      definition: Function | Object\n    ): Function | Object | void {\n      if (!definition) {\n        return this.options[type + 's'][id]\n      } else {\n        /* istanbul ignore if */\n        if (process.env.NODE_ENV !== 'production') {\n          if (type === 'component' && config.isReservedTag(id)) {\n            warn(\n              'Do not use built-in or reserved HTML elements as component ' +\n              'id: ' + id\n            )\n          }\n        }\n        if (type === 'component' && isPlainObject(definition)) {\n          definition.name = definition.name || id\n          definition = this.options._base.extend(definition)\n        }\n        if (type === 'directive' && typeof definition === 'function') {\n          definition = { bind: definition, update: definition }\n        }\n        this.options[type + 's'][id] = definition\n        return definition\n      }\n    }\n  })\n}","sourceCodeStart":4,"sourceCodeEnd":40,"githubUrl":"https://github.com/Meituan-Dianping/mpvue/blob/6c5d78ee04f58c6d782c456dfcf0fe63c0b7f89b/src/core/global-api/assets.js#L4-L40","documentation":"Dev-only warning in initAssetRegisters when registering a component via Vue.component(): the id passed matches config.isReservedTag, i.e. a built-in or HTML element name (div, button, etc.). Registering such an id would shadow native elements in templates, so the registration is warned against and skipped.","triggerScenarios":"Thrown at src/core/global-api/assets.js:22 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Rename the component to an id that is not a native HTML tag (e.g. my-button)","Follow multi-word component naming to avoid all reserved-tag collisions"],"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"}