question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Production] Failed to mount component: template or render function not defined.

See original GitHub issue

I 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:closed
  • Created 6 years ago
  • Comments:13 (2 by maintainers)

github_iconTop GitHub Comments

22reactions
njleonzhangcommented, Jun 16, 2017

I add vue-loader twice in webpack rule property, which cause this issue. I don’t know if this is a bug?

18reactions
LinusBorgcommented, Jul 13, 2017

Have you read the release notes and made sure that you fixed all require() and require.ensure calls you might have used?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found