Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

composition api error occured while using ov-icons alongside with other lib that requires composition-api #21

Closed
bug4j opened this issue Apr 1, 2022 · 1 comment
Labels
bug Something isn't working

Comments

@bug4j
Copy link

bug4j commented Apr 1, 2022

to my knowledge, ov-icon dose not need me to to install composition api plugin myself.
and there is a problem,when other lib like vue-echarts, which needs to install compositon api manually,
and as i do so, the ov-icon magicly dose not work properly,and i get an error in the console like :

vue.runtime.esm.js?eae5:619 
        
       [Vue warn]: onMounted is called when there is no active component instance to be associated with. Lifecycle injection APIs can only be used during execution of setup().
warn @ vue.runtime.esm.js?eae5:619
warn @ vue-composition-api.esm.js?237c:420
getCurrentInstanceForFn @ vue-composition-api.esm.js?237c:452
eval @ vue-composition-api.esm.js?237c:1104
setup @ Icon.ts?42e1:253
mergedSetupFn @ vue-composition-api.mjs?0212:2157
eval @ vue-composition-api.mjs?0212:1969
activateCurrentInstance @ vue-composition-api.mjs?0212:1888
initSetup @ vue-composition-api.mjs?0212:1967
wrappedData @ vue-composition-api.mjs?0212:1950
getData @ vue.runtime.esm.js?eae5:4761
initData @ vue.runtime.esm.js?eae5:4717
initState @ vue.runtime.esm.js?eae5:4655
Vue._init @ vue.runtime.esm.js?eae5:5020
VueComponent @ vue.runtime.esm.js?eae5:5168
createComponentInstanceForVnode @ vue.runtime.esm.js?eae5:3304
init @ vue.runtime.esm.js?eae5:3133
createComponent @ vue.runtime.esm.js?eae5:6022
createElm @ vue.runtime.esm.js?eae5:5969
createChildren @ vue.runtime.esm.js?eae5:6097
createElm @ vue.runtime.esm.js?eae5:5998
patch @ vue.runtime.esm.js?eae5:6521
Vue._update @ vue.runtime.esm.js?eae5:3960
updateComponent @ vue.runtime.esm.js?eae5:4081
get @ vue.runtime.esm.js?eae5:4495
Watcher @ vue.runtime.esm.js?eae5:4482
mountComponent @ vue.runtime.esm.js?eae5:4088
Vue.$mount @ vue.runtime.esm.js?eae5:8459
init @ vue.runtime.esm.js?eae5:3137
createComponent @ vue.runtime.esm.js?eae5:6022
createElm @ vue.runtime.esm.js?eae5:5969
patch @ vue.runtime.esm.js?eae5:6560
Vue._update @ vue.runtime.esm.js?eae5:3960
updateComponent @ vue.runtime.esm.js?eae5:4081
get @ vue.runtime.esm.js?eae5:4495
Watcher @ vue.runtime.esm.js?eae5:4482
mountComponent @ vue.runtime.esm.js?eae5:4088
Vue.$mount @ vue.runtime.esm.js?eae5:8459
eval @ main.js?fbea:15
./src/main.js @ app.js:30
__webpack_require__ @ app.js:158
found in

---> <OhVueIcon>
       <App> at src/App.vue
         <Root>

i just using the vue create app default source code , and modified my main.js to the content below:

import Vue from 'vue'
import VueCompositionApi from '@vue/composition-api';
Vue.use(VueCompositionApi);

import App from './App.vue';
import { OhVueIcon, addIcons } from "oh-vue-icons";
import { LaRulerSolid,LaSunSolid, LaMoonSolid, LaSearchSolid } from "oh-vue-icons/icons/la";
import { IoCloseOutline,IoLayersOutline  } from 'oh-vue-icons/icons/io';

Vue.component("ov-icon", OhVueIcon);
addIcons(LaRulerSolid, LaSunSolid, LaMoonSolid, LaSearchSolid, IoCloseOutline, IoLayersOutline);

Vue.config.productionTip = false

new Vue({
  render: h => h(App),
}).$mount('#app')

it's urgent for me , hope a resolution will emerge soon. thanks.

@Renovamen Renovamen added the bug Something isn't working label Apr 24, 2022
Renovamen added a commit that referenced this issue Apr 24, 2022
@Renovamen
Copy link
Owner

Hi, this bug is caused a dependency (vue-demi) conflict and should be fixed in the latest release (v1.0.0-rc3). Thanks for reporting!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants