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.

[Vue warn]: Failed to mount component: template or render function not defined. (found in root instance)

See original GitHub issue

When I compiled using laravel mix in one of my old projects I get this error

[Vue warn]: Failed to mount component: template or render function not defined. 
(found in root instance

it works fine on Laravel elixir. why do I get this error?

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:36

github_iconTop GitHub Comments

314reactions
adelynxcommented, Dec 5, 2018

It should be require(‘./components/Example.vue’).default. Since v13, vue-loader exports the component as the default key, which still works the same when using import, but requires the above when using require.

35reactions
audetcameroncommented, May 23, 2019

So is the answer changing

 Vue.component('example-component', require('./components/ExampleComponent.vue'));

to

 Vue.component('example-component', require('./components/ExampleComponent.vue').default);

for all components?

Update:

https://laravel-mix.com/docs/4.0/upgrade

😃

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 >
Failed to mount component: template or render function not ...
Error in Console vue.runtime.esm.js?2b0e:619 [Vue warn]: Failed to mount component: template or render function not defined. found in ...
Read more >
[Vue warn]: Failed to mount component: template or render ...
When I compiled using laravel mix in one of my old projects I get this error [Vue warn]: Failed to mount component: template...
Read more >
Laravel + Vue.js - template or render function not defined.
Hi, I am trying to use vue-router links to load my home and about.vue but I get this error: app.js:64725 [Vue warn]: Failed...
Read more >
[SOLVED] Component is Missing Template Or Render ...
The “Component is missing template or render function” warning occurs when you import a component and add it to the markup, but the...
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