I am getting an obscure error that my component name is zero. But none of my components have a zero for a name. This error is hard to track down. Anyone know what the problem could be so I can move in the right direction to tackle it.
vendor.js:66537 [Vue warn]: Invalid component name: "0". Component names can only contain alphanumeric characters and the hyphen, and must start with a letter.
Heres more information on the error:
Edit: More information:
I have a unique project structure. I have single file components. And each component is split into 2 files like so:
Home.vue:
<template>
...
</template>
<style lang="scss">
...
</style>
<script src="./home.js"></script>
home.js:
export default {
...
}
Edit: debug capture
Edit: home.js
import RecentPostsWidget from './widgets/RecentPosts'
import PagesWidget from './widgets/Pages'
export default {
components: {
RecentPostsWidget,
PagesWidget
}
}
I had the same error and it was caused by use of array instead of object in the components. This is how it should looks like
components: {
RecentPostsWidget,
PagesWidget
}
This is how I had it when the error appeared:
components: [
RecentPostsWidget,
PagesWidget
]
Try replacing
components: {
RecentPostsWidget,
PagesWidget
}
with
components: {
recentPostsWidget: RecentPostsWidget,
pagesWidget: PagesWidget
}
look somewhere for a component that you are using braces: [] and change them to {} Example:
components: [
Logo,
Nav
],
Switch to:
components: {
Logo,
Nav
},
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With