Vue3 Plugin - "[Vue warn]: Failed to resolve component: q-btn If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement." #17068
Unanswered
darko7k
asked this question in
General - Components / Directives / etc
Replies: 1 comment 1 reply
-
quasar-user-options file is for the Vite plugin or Vue CLI plugin, whereas |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, I am creating a plugin in an already existing Vue3 + Quasar2 project. In this project I use Quasar components all the time without the specific need of importing or declaring them anywhere. But, when I tried converting my .vue file reusable component as a .js file plugin, I came across this error:
"[Vue warn]: Failed to resolve component: q-btn
If this is a native custom element, make sure to exclude it from component resolution via compilerOptions.isCustomElement."
The plugin contains the "template" property where my HTML code is placed:
If I import the quasar components in the quasar-user-options file, everything works as expected, but as I found out it seems that this file (or any other file from the .quasar folder) should not be edited:
`/**
**/
import iconSet from 'quasar/icon-set/material-icons'
import {QBtn,QTable,QItem,QList,QIcon,QInput,QSeparator,QCardSection,QCard,QCardActions,QBtnDropdown,QSpace,QTooltip,QToolbar,QTh,QTd,QItemSection,QMenu,Ripple,Notify,Dialog} from 'quasar'
export default { config: {},iconSet,components: {QBtn,QTable,QItem,QList,QIcon,QInput,QSeparator,QCardSection,QCard,QCardActions,QBtnDropdown,QSpace,QTooltip,QToolbar,QTh,QTd,QItemSection,QMenu},directives: {Ripple},plugins: {Notify,Dialog} }
`
I tried importing and declaring them in the quasar.conf.js, in the plugin file, and what not but nothing is working. I am looking for help from anyone who has knowledge about this. I am here to provide more explanation if you need it. Thank you in advance.
P.S. I needed to change this line from : import { createApp } from 'vue' to : import { createApp } from 'vue/dist/vue.esm-bundler.js'
Can I push this change to production? Will it break anything? I believe not but still I want to make sure :)
Beta Was this translation helpful? Give feedback.
All reactions