Jon Gallant

Solution to Vue.js Error - Unknown custom element - did you register the component correctly? For recursive components, make sure to provide the name option.

1 min read

I’m building a recursive Vue.js component and ran into this error:

Unknown custom element: <Categories> - did you register the component correctly? For recursive components, make sure to provide the "name" option.
```text
![000063](/2019/03/vuejs-unknown-custom-element/000063.png)
My @Component registration looked like this:
```javascript
@Component({
components: {
RatingBar,
Items,
Categories
}
})
```text
The solution is super-simple, but non-obvious.
You just need to add a name property like so:
```javascript
@Component({
name: 'Categories',
components: {
RatingBar,
Items,
Categories
}
})

And the problem is solved.

Hope this helps.

Jon

Share:
Share on X