Subscribe on changes!

multiple instances of Vue

avatar
Sep 13th 2020

Version

3.0.0-rc.10

Reproduction link

https://github.com/facebook/react/issues/13991

Steps to reproduce

If I use npm link to import a custom composition api library, The composition api will not work. I guess there are two identical vue3.x

Create two vue3.x projects and develop composition api library One uses npm link and the other uses npm link project-name.

React hooks has the same problem :

https://github.com/facebook/react/issues/13991

What is expected?

Facilitate local code development

What is actually happening?

If I use npm link to import a custom composition api library, The composition api will not work. I guess there are two identical vue3.x

avatar
Sep 13th 2020

We are aware of this pitfall and it's something we need to document for library authors.

@bencodezen I didn't transfer the issue because I imagine we want to write something different to track this at https://github.com/vuejs/docs-next

avatar
Sep 13th 2020

This was a problem in v2 as well for libraries using Vue.extend(), there's some discussion about it in https://github.com/vuetifyjs/vuetify/discussions/4068

avatar
Sep 13th 2020

This was a problem in v2 as well for libraries using Vue.extend(), there's some discussion about it in vuetifyjs/vuetify#4068

thank you

avatar
Sep 13th 2020

You'll have to npm link vue in your composition library as well. Yes, that's disturbing.