2.5.17
https://jsfiddle.net/gjx1wvhk/
Just run the code
No error
Shows error in console
Hi, I use *.vue components, and I have following error: "Unknown custom element:
Here is sample fiddle to reproduce this error:
https://jsfiddle.net/gjx1wvhk/ (open developer console to see error)
There is small difference between fiddle and my code, I use *.vue components, import them relatively and add as components fields to my components:
import CommentsList from './CommentsList.vue'
export default {
name: 'comments',
components: {
CommentsList,
},
...
}
import CommentsList from './CommentsList.vue'
export default {
name: 'comment',
components: {
CommentsList,
},
...
}
import Comment from './Comment.vue'
export default {
name: 'comments-list',
components: {
Comment,
},
...
}
This is because both of your components depend on each other. I'm not sure what was the right approach but I'm pretty sure I saw it documented. Maybe it's using a dynamic import in one of the components. cc @chrisvfritz
did you register the component correctly?
The first argument to Vue.component
must be a string: https://vuejs.org/v2/api/#Vue-component
There we go: https://vuejs.org/v2/guide/components-edge-cases.html#Circular-References-Between-Components
@posva Thanks a lot!
@KaelWD Re: The first argument to Vue.component must be a string
That was just to make an example, I don't use Vue.component, I use modules with Webpack.
Yeah I kinda glossed over that bit lol, still an error in the repro though. CodeSandbox is usually better for multi-component examples like that, especially when it's something caused by webpack.
i'm having same issue but it's regardig the
Most helpful comment
There we go: https://vuejs.org/v2/guide/components-edge-cases.html#Circular-References-Between-Components