[Vue warn]: [vue-composition-api] already installed. Vue.use(VueCompositionAPI) should be called only once. thrown when using Vue2, composition api, and Pinia #716
Replies: 5 comments 5 replies
-
I need a boiled down repro to check. Pinia didn't add the composition api, so that's weird |
Beta Was this translation helpful? Give feedback.
-
I tried adding this to an existing internal project but I can try spinning up a test project to see if I can reproduce it when I have time. I checked the source code here and didn't see any Vue.use(VueCompositionApi) so I also thought it was weird. If I comment out Pinia though it works perfectly fine. I was wondering if maybe vue-demi was causing some issue since that uses the composition-api but I'm not sure. |
Beta Was this translation helpful? Give feedback.
-
@posva |
Beta Was this translation helpful? Give feedback.
-
You have 2 |
Beta Was this translation helpful? Give feedback.
-
@posva Thank you so much. This library looks really awesome and I would really like to adopt it in all of our projects. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Reproduction
I am trying to add Pinia to a Vue2 project with the composition API. I following the docs and installed pinia and vue @vue/composition-api using
npm install pinia @vue/composition-api
. In main.ts I have:I created a simple test component for testing the composition API. This works perfectly fine before I add Pinia. Once I add Pinia, I start getting the following errors:
[Vue warn]: [vue-composition-api] already installed. Vue.use(VueCompositionAPI) should be called only once.
[Vue warn]: Error in data(): "Error: [vue-composition-api] No vue dependency found."
Additional information
Versions:
"@vue/composition-api": "^1.2.4"
"vue": "^2.6.14"
"pinia": "^2.0.0-rc.12"
Beta Was this translation helpful? Give feedback.
All reactions