[Production] Failed to mount component: template or render function not defined.
See original GitHub issueI bootstrap my app in this way. It’s works when dev, but if I release the project, I encounter this issue.
import App from './App'
/* eslint-disable no-new */
new Vue({
el: '#app',
template: '<App/>',
components: { App },
router
})
error stack:
vue.js:440 [Vue warn]: Failed to mount component: template or render function not defined.
found in
---> <App>
<Root>
warn @ vue.js:440
mountComponent @ vue.js:2413
Vue$3.$mount @ vue.js:7565
Vue$3.$mount @ vue.js:9664
init @ vue.js:3356
createComponent @ vue.js:4895
createElm @ vue.js:4838
patch @ vue.js:5337
Vue._update @ vue.js:2320
updateComponent @ vue.js:2443
get @ vue.js:2780
Watcher @ vue.js:2763
mountComponent @ vue.js:2447
Vue$3.$mount @ vue.js:7565
Vue$3.$mount @ vue.js:9664
Vue._init @ vue.js:4004
Vue$3 @ vue.js:4089
78 @ main.js:11
__webpack_require__ @ bootstrap 5b2fa1d…:54
webpackJsonpCallback @ bootstrap 5b2fa1d…:25
(anonymous) @ app.15bc53d….js:1
vue loader version:
“vue”: “^2.3.3”, “vue-loader”: “^12.2.1”
Issue Analytics
- State:
- Created 6 years ago
- Comments:13 (2 by maintainers)
Top Results From Across the Web
Vue template or render function not defined yet I am using ...
This error: [Vue warn]: Failed to mount component: template or render function not defined. You're getting because of a certain problem ...
Read more >Vue warn - template or render function not defined.
I did a npm update and composer update today and now I get the error everywhere where I use vue : [Vue warn]:...
Read more >Failed to mount component: template or render function not ...
A render function takes an argument which itself is a function. This function creates you a vnode. The render function expects you to...
Read more >Error when using Vue Templates: Failed to mount component
[Solved]-Error when using Vue Templates: Failed to mount component: template or render function not defined-Vue.js ... see the installation instructions from here ...
Read more >template or render function not defined. 错误的解决方法 ...
Vue.js 2 遇到vue.runtime.common.js?d43f:511 [Vue warn]: Failed to mount component: template or render function not defined.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I add
vue-loader
twice in webpackrule
property, which cause this issue. I don’t know if this is a bug?Have you read the release notes and made sure that you fixed all
require()
andrequire.ensure
calls you might have used?