VSF-Next: [vue-composition-api] No vue dependency found

Dear Community,

we are developing with VSF-Next and have the following situation:

  • created our own package for developing custom functionality (‘customer’)
  • wrote useCartExtended method in customer/composables package (see Screen 1)
  • impored this useCartExtended in a Storefront page (AppHeader.vue, Screen 2)
  • This leads to the error [vue-composition-api] No vue dependency found in the Storefront (Screen 3)

It seems the import of useCart in Screen 1 (line 1) ist causing this error.

I tried the suggested solution as outlined here:

(Overwriting useUIState.ts and importing the composition-api as seprarate js-file)

Unfortunately this did not help to solve the problem :frowning:

Any help would greatly appreciated.

Screen1:

Screen 2:

Screen 3:

Hi @Alexander_Seitz,

Thank you for providing detailed description of the issue. I tested this and can confirm that it will be fixed with this PR:

As a workaround, you can add @vue-storefront/commercetools to build > transpile array in nuxt.config.js.

In short, it’s caused by the fact that currently each package in our monorepo has all dependencies installed separately. This means that your newly created customer theme installed vue-composition-api plugin (via core nuxt-module), but @vue-storefront/commercetools uses it’s own vue-composition-api that isn’t installed the same way, causing this error.
When PR above is merged, all packages will use the same instance of vue and composition-api, fixing this issue.

2 Likes

@filip.sobol Thanks for the answer. Unfortunately your suggested workaround with the transpile modification did not work for me. :frowning:

@Fifciuu Nevertheless, is there any timeline, when the PR will be available in the VSF-next branch to fix the problem officially along with the yarn install bug?

Thanks and kind regards,

Alexander

It worked for me yesterday, however the difference is that I copied everything from boilerplate to customer directory and then followed the steps from the screenshots.

Anyway, it might not be worth digging into, because we plan to merge this fix today. It will be required to reinstall all dependencies (run lerna clean and remove node_modules from the root of the project), just to clean up everything that’s not needed anymore.

1 Like

Wonderful, I applied the PR and now it works, thx so much! :slight_smile: