How to properly set a library using Composition API?


I’m trying to extract npm package with components using inject with @vue/composition-api.
In the library I have @vue/composition-api as a dev and peer dependency and I call Vue.use(VueCompositionApi) as a very first thing in my main project (not the library). main.js in the library is just exporting the component.

But I’m getting a
Error in data(): "Error: [vue-composition-api] "inject" get called outside of "setup()""

Not clear to me why…

I have a simple demo importing just one component from the library, but I’m not able to break it through…

Any ideas?