|
Hi, this project looks awesome, but I'm struggling to get it working with my code. I want to specify store-specific options, so I followed the example in README: Unfortunately, this yields an error: I'm sure I'm doing something wrong on my side, but I can't seem to figure out what it is :-) Any ideas, please? |
Replies: 2 comments
|
I cannot reproduce this 😞 , can you provide a minimal reproduction. (You can use We need to know something like which Maybe you can try to upgrade to latest version: |
|
OK, I think I figured it out while experimenting with the codesandbox. My setup is slightly specific - I have a monorepo with several subprojects - one of them is a library that defines the store, another one is a Vue app that actually takes care of creating Pinia and instantiating the store. I had Adding to the file with the store definition (even if I don't actually use the type) makes the compiler error go away and all seems to work, yay! |
OK, I think I figured it out while experimenting with the codesandbox.
My setup is slightly specific - I have a monorepo with several subprojects - one of them is a library that defines the store, another one is a Vue app that actually takes care of creating Pinia and instantiating the store. I had
pinia-plugin-persistedstate-2installed in both the library and the app, but I did not import it in the library, just in the app. Thus, thedeclare module "pinia"code from this plugin did not get included in the library code and TS wasn't aware of the plugin at all.Adding
to the file with the store definition (even if I don't actu…