Using Pinia In OnBeforeRender #757
Unanswered
hamedg68
asked this question in
Help & Questions
Replies: 1 comment 2 replies
-
Have you found a solution? (PR welcome to https://vite-plugin-ssr.com/pinia btw.) |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
According to Pinia example I can not use Pinia in onBeforeRender hook when server runs at first, because it has not activated yet, but by reloading the page it works.
Error message :
_Error: [🍍]: getActivePinia was called with no active Pinia. Did you forget to install Pinia?_
I know the solution is using onServerPrefetch but if I use this option I miss some VPS features for instance set title for each page which is fetched from server.
Is there any way to solve this issue, I mean when serve runs, at first loading, Pinia get activated in onBeforeRender ?
Beta Was this translation helpful? Give feedback.
All reactions