-
Notifications
You must be signed in to change notification settings - Fork 344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to properly setup a npm package using Composition API? #340
Comments
You only need to call the |
I'm not linking library from disc, but have it installed from npm - if it makes difference. In other words - basically I have a project working I'm trying to extract the components to it's own lib. Those components are using |
That's what I meant. Take a look at the issue above, it's the same problem, there are a few workarounds 🙂 |
Well, I know #228 of course. I have read it through, but still didn't get it working. Still getting the same |
I have a npm package using components which are calling
inject
:In lib package.json I have set
@vue/composition-api
as a peer dependency.In my main project (not library), I'm registering Composition API and using provide like this:
But I'm getting
Error in data(): "Error: [vue-composition-api] "inject" get called outside of "setup()""
Is it ok I'm calling
Vue.use(VueCompositionApi);
in the main project and anywhere in the library?BTW: should I use Vue and Vuex as a peer dependencies as well in the library?
The text was updated successfully, but these errors were encountered: