Can't initialize stores #2893
Unanswered
ejerskov
asked this question in
Help and Questions
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Nuxt 3.14.1592 with @pinia/nuxt 0.9.0.
In my app, I need to initialize the useSettingsStore SSR because I need some settings before loading the app.
I have tried various ways to do this, some working locally, but all failing on production (Vercel)
From what I can read I should be enough to just add
'@pinia/nuxt'
, to modules in nuxt.config.ts.But when I call a store from App.vue I get an error:
Error:
I then tried to add this to Vue.app:
.. and now its working locally.
But on production, I then get this error:
Cannot set property $pinia of #<Object> which has only a getter
I also tried to move this logic to a plugin, but it gives the same errors.
How do I initialize the stores correctly?
Beta Was this translation helpful? Give feedback.
All reactions