Composition-api: usage with nuxt-vite module cause error

Created on 9 Mar 2021  ·  3Comments  ·  Source: nuxt-community/composition-api

🐛 The bug
Usage with @nuxt/vite module doesn't work properly

🛠️ To reproduce
Steps to reproduce the behavior:

  1. Install module https://github.com/nuxt/vite and @nuxt/composition-api plugin
  2. Then try declare defineComponent imported from @nuxtjs/composition-api
  3. Now run npm run dev command and see following error: ERROR [Vue warn]: [vue-composition-api] already installed. Vue.use(VueCompositionAPI) should be called only once.

🌈 Expected behaviour
Should be work properly with nuxt-vite module

bug

Most helpful comment

@theartkod At the moment, you'll need to install @vue/composition-api as a top level devDependency of your project rather than relying on the version provided by @nuxtjs/composition-api. Follow https://github.com/nuxt/vite/pull/79 for updates.

All 3 comments

@theartkod At the moment, you'll need to install @vue/composition-api as a top level devDependency of your project rather than relying on the version provided by @nuxtjs/composition-api. Follow https://github.com/nuxt/vite/pull/79 for updates.

@danielroe thank you so much!

@theartkod You're very welcome ❤️

Was this page helpful?
0 / 5 - 0 ratings