{"record":{"id":"e1b592a85043580d","repo":"Meituan-Dianping/mpvue","slug":"failed-to-mount-component-template-or-render-func","errorCode":null,"errorMessage":"Failed to mount component: template or render function not defined.","messagePattern":"Failed to mount component: template or render function not defined\\.","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/core/instance/lifecycle.js","lineNumber":158,"sourceCode":"  vm: Component,\n  el: ?Element,\n  hydrating?: boolean\n): Component {\n  vm.$el = el\n  if (!vm.$options.render) {\n    vm.$options.render = createEmptyVNode\n    if (process.env.NODE_ENV !== 'production') {\n      /* istanbul ignore if */\n      if ((vm.$options.template && vm.$options.template.charAt(0) !== '#') ||\n        vm.$options.el || el) {\n        warn(\n          'You are using the runtime-only build of Vue where the template ' +\n          'compiler is not available. Either pre-compile the templates into ' +\n          'render functions, or use the compiler-included build.',\n          vm\n        )\n      } else {\n        warn(\n          'Failed to mount component: template or render function not defined.',\n          vm\n        )\n      }\n    }\n  }\n  callHook(vm, 'beforeMount')\n\n  let updateComponent\n  /* istanbul ignore if */\n  if (process.env.NODE_ENV !== 'production' && config.performance && mark) {\n    updateComponent = () => {\n      const name = vm._name\n      const id = vm._uid\n      const startTag = `vue-perf-start:${id}`\n      const endTag = `vue-perf-end:${id}`\n\n      mark(startTag)","sourceCodeStart":140,"sourceCodeEnd":176,"githubUrl":"https://github.com/Meituan-Dianping/mpvue/blob/6c5d78ee04f58c6d782c456dfcf0fe63c0b7f89b/src/core/instance/lifecycle.js#L140-L176","documentation":"Raised from mountComponent when the component has no render option at all: vm.$options.render is falsy, so Vue substitutes createEmptyVNode and (in dev) warns that neither a template nor a render function was resolved. Unlike the runtime-only-build warning, this means the final options contained no compiled render function — typically the component is an empty object, a broken mixin overwrote render, or the file exports nothing usable.","triggerScenarios":"Thrown at src/core/instance/lifecycle.js:158 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Give the component a template or a render function in its options","Check that the component file actually exports its definition object (default export present, no typo like exporting undefined)","If using runtime-only Vue, ensure the template was pre-compiled; verify mixins or extend chains are not wiping out the render option"],"exampleFix":null,"handlingStrategy":"fallback","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"}