composition-api: Error: [vue-composition-api] already installed after upgrading @vue/composition-api

Describe the bug After updating the package @vue/composition-api. we’re receiving the error below and the page is not rendered:

Error: [vue-composition-api] already installed.

This works fine:

// package.json
"dependencies": {
    "@vue/apollo-composable": "^4.0.0-alpha.10",
    "@vue/composition-api": "1.0.0-beta.10",

This does not:

// package.json
"dependencies": {
    "@vue/apollo-composable": "^4.0.0-alpha.10",
    "@vue/composition-api": "1.0.0-beta.11",

Quasar boot file:

import Vue from 'vue'
import VueCompositionApi from '@vue/composition-api'

Vue.use(VueCompositionApi)

About this issue

  • Original URL
  • State: closed
  • Created 4 years ago
  • Comments: 18 (11 by maintainers)

Most upvoted comments

@Petercopter just released vue-demi@0.3.2, can you try to remove the lock and node_modules and then reinstall them again? Thanks

@Petercopter, It should be the exporting conflict with vue-demi, working on the fix now.

You’re right, if I replace the content of my boot file form this:

import Vue from 'vue'
import VueCompositionApi from '@vue/composition-api'

Vue.use(VueCompositionApi)

To this:

import '@vue/apollo-composable'

It works too. Is that what you meant? I really thought I had to load the VueCompositioinApi as a plugin with Vue.Use(). Appears this is not needed at all. Thanks for the tip :_

👍 That did the trick. I can’t delete my yarn.lock right now, so I tracked down that @vue/apollo-composable was using vue-demi latest, and upgraded that as well. Everything looks fine from here, thanks for jumping on that! You are appreciated 🤗