Template or render function not defined.
See original GitHub issueAfter e few hours of pulling my hair and furious googling, I can’t come up with an other solution then to open this issue.
I tried to include multiselect (2.0 branch) into my vue 2.0 project. Unfortunately, the components doesn’t want to work, giving me the following error:
[Vue warn]: Failed to mount component: template or render function not defined. (found in component <Multiselect>)
I know that this has something to do with the standalone built vs realtime only buit. But even when I include Vue using import Vue from 'vue/dist/vue.js'
(or the suggested alias way), it still gives me this issue. I also checked your package, and it seems you don’t even use render options afaik.
I’m using the component in a Vue/Laravel/Elixir setup which uses webpack.
I add your component using the following line (just like all my other components):
Vue.component('Multiselect', require('vue-multiselect'));
Unfortunately, all of your examples give me the same issue.
Any idea where to look for a solution?
Issue Analytics
- State:
- Created 7 years ago
- Comments:14 (6 by maintainers)
Top GitHub Comments
This solved the issue:
Thanks a lot! 😃
Crap. Really sorry to hear that. 😔
Not sure why the default import doesn’t work out of the box when using
require()
. I will look into it later. Thanks for bringing this up.Anyway, there are several workarounds for this:
Either use es6 modules:
Or do it this way.