Unknown custom element: [ ... ] - did you register the component correctly?
See original GitHub issueI’m getting this error for each html tag of Vuetify. I installed Vuetify using
npm install --save-dev vuetify
In my main.js I have :
const Vue = require("vue");
const Vuetify = require("vuetify");
const tracksList = require("./track-list.vue");
Vue.use(Vuetify);
trackList = new Vue({el: "#track-list", template: "<tracksList/>", components: {tracksList}});
The file track-list.vue is :
<template src="../templates/track-list-component.html"></template>
<script src="./track-list.js"></script>
In my template track-list-component.html, here is the part which uses Vuetify :
<div class="track-name-row"
v-on:click="expandTrack(project.structure.tracks.indexOf(track))"
@contextmenu="show">
<li class="track-color-viewer"></li>
<span>{{"Track "+project.structure.tracks.indexOf(track)}}</span>
<img class="item-view" src="../assets/img/ic_view.svg" alt="view">
</div>
<v-menu offset-y v-model="showMenu" :position-absolutely="true" :position-x="x" :position-y="y">
<v-list>
<v-list-tile>
<v-list-tile-title>test</v-list-tile-title>
</v-list-tile>
</v-list>
</v-menu>
The track-list.js is a simple Vue component :
//another component I am using : vuedraggable
const draggable = require("vuedraggable");
module.exports = {
name: "track-list",
components: {
draggable
},
data() {
return {
//used for vuedraggable
isDragging: false,
//used for vuetify
showMenu: false,
x: 0,
y: 0
};
}
}
For importing Vuetify, is there other things to do than installing Vuetify with npm and using Vue.use(Vuetify) in main.js? I am a bit lost and sad, this lib seems to be really great.
Issue Analytics
- State:
- Created 6 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
How to Solve "Unknown Custom Element" in Vue
Registering components correctly. In Vue, you need to register custom components before you can use them. Regular HTML tags like <div> , < ......
Read more >Vue.js unknown custom element - Stack Overflow
component () , it registers components globally. You can create file, name it MyTask. vue, export there Vue object https://v2.vuejs.org/v2/guide ...
Read more >Unknown custom element, did you register the component ...
Hi all, I've run into a really weird problem. I've got 2 circular components which represent a graph, it's super simple.
Read more >[Vue warn]: Unknown custom element: <example-component>
[Vue warn]: Unknown custom element: <example-component> - did you register the component correctly? Laravel comes with example-component right our of the box, ...
Read more >Solution to Vue.js Error - Unknown custom element - did you ...
I'm building a recursive Vue.js component and ran into this error: Unknown custom element: - did you register the component correctly?
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Aah, I totally missed that you were using
require
and notimport
.When a module does this
the resulting export becomes
When you
import
, it will automatically import the default property (unless you specify anything else).require
does not do this automatically, which is why you need to specify.default
I found the solution, someone of StackOverflow gave me a solution By changing
const Vuetify = require("vuetify")
toconst Vuetify = require("vuetify").default
…it works. But I don’t really understand what happened here.Going to check.