Build components that depend on pinia in library mode #1059
-
I'm trying to build a component that depend on pinia to a npm package so I can import from another application. However currently I'm getting this error:
Even though I have already installed pinia in my main application. Is this the expected behavior ? Though I have a feeling it might not be a good practice to include pinia or states into a library, I wanted to check if anyone else has encountered this problem. |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 4 replies
-
Did you solve this? We have the same issue, where we have component library (that uses Pinia) and a main application that consumes the components (this application is also using Pinia). I can make it work by passing the active Pinia instance into an initialize components function that we use, then use
|
Beta Was this translation helpful? Give feedback.
-
Make sure to:
|
Beta Was this translation helpful? Give feedback.
Make sure to: