Closed Kvn91 closed 2 years ago
Hey @Kvn91
Thanks for rising that issue. I dont think however that it is caused by the integration itself. You are using a nuxt module in a nuxt based project. The fact that it is triggered in the Storefront UI component means only that it is a first component on a page (not that it is caused by Vue Storefront or Storefront UI)
Not sure, but Vue apollo composable can be meant for the Vue 3 only, while VSF is a Nuxt 2 (Vue 2 in the end).
Not sure, but Vue apollo composable can be meant for the Vue 3 only, while VSF is a Nuxt 2 (Vue 2 in the end).
Precisely, it's meant for Vue 2 & 3 (https://v4.apollo.vuejs.org/guide-composable/setup.html)
I finally got it working with @vue/apollo-composable@4.0.0-alpha.5, didn't try other versions yet
Awesome @Kvn91!
Closing the issue then 🙂
Expected Behavior
Being able to configure and use @vue/apollo-composable to send graphql mutations and queries
Actual Behavior
When configuring and trying to use @vue/apollo-composable, the front is somehow crashing and logging errors :
Possible Solution
Could be a conflict caused by the peer dependency on @vue/composition-api, see https://github.com/nuxt-community/apollo-module/issues/288
Steps to reproduce
Init a new VSF project. Add apollo :
yarn add @nuxtjs/apollo @vue/apollo-composable
In
nuxt.config.js
add :The alias section is fixing https://github.com/vueuse/vue-demi/issues/106
In
/plugins/provide-apollo-client.ts
add :This configuration is the one making nuxt working with apollo-composable according to https://github.com/nuxt-community/apollo-module/issues/288
Launch the front, go on a page, and see errors logging
What version of vendure integration are you using?
1.2.0
What version of Node.js are you using?
v16.15.0
What browser (and version) are you using?
Chrome 103.0.5060.114 (arm64)
What operating system (and version) are you using?
macOS Monterey 12.2.1
Relevant log output
Code of Conduct