-
-
Notifications
You must be signed in to change notification settings - Fork 977
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nuxt 2 - using a store in a plugin outputs an error in console #1063
Comments
The problem is the devtools plugin requires the app to exist in order to be used. Unsure if this is something that should be fixed here or in vue-devtools or if it is actually fixable as nuxt plugins might be executed too early for it to work. |
@posva It's been a while, but I'm facing the same issue while migrating from vuex to pinia. Is there no way to use pinia inside nuxt plugin then? Any advise about how to manage nuxt plugin logic during migration? |
It should work, this error is just about devtools. Normally, Nuxt plugins added in modules are installed before user plugins. Other than that, any help in fixes or docs are very welcome as I really don't have the bandwidth to give this more time. |
Reproduction
https://github.com/guillaumeduliscouet/example-nuxt-2
It is a fork of the official exemple with only this added as a nuxt plugin:
Steps to reproduce the behavior
Expected behavior
Using a store in a plugin should be possible (right ?) without breaking the devtools
Actual behavior
Everything seems to work in the devtools, but:
"user" store installed
does not appearHere is what I have if I remove the store usage in the plugin:
Additional information
I imagine that the plugin gets called before the Vue app creation ? Seems like pinia is trying to install it's devtools plugin with
app: null
The text was updated successfully, but these errors were encountered: