Skip to content
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

fix: install devtools plugin only after app is created and installed (#1063) #1392

Draft
wants to merge 2 commits into
base: v2
Choose a base branch
from

Conversation

popov-a-e
Copy link

Closes #1063

Turned out in nuxt plugin environment, pinia._a is not yet defined which resulted in devtools unable to find app record.

@netlify
Copy link

netlify bot commented Jun 24, 2022

Deploy Preview for pinia-official canceled.

Name Link
🔨 Latest commit 9ea96a4
🔍 Latest deploy log https://app.netlify.com/sites/pinia-official/deploys/62b767aeaee0a700094b0c47

@posva
Copy link
Member

posva commented Jun 25, 2022

Thanks for the PR but this completely changes the behavior of plugins. The fix should be possible with minimal changes and without changing how stores are initialized

@popov-a-e
Copy link
Author

OK, I ended up applying same logic to devtools plugin only.
Tests checked.

@popov-a-e popov-a-e changed the title fix: install plugins after app is set (#1063) fix: install devtools plugin only after app is created and installed (#1063) Jun 28, 2022
@popov-a-e
Copy link
Author

@posva Hi Eduardo, is it OK now?

Copy link
Member

@posva posva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks but we really want to avoid adding any new hook like this.
Instead, let's move this kind of logic to the devtools: if the registerPiniaDevtools() haven't been called yet, we buffer the pending stores and once the devtools are registered, we add the store to the devtools.

@posva posva marked this pull request as draft April 17, 2024 07:57
@posva posva added the vue 2.x Specific to Vue 2 usage label Jul 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
vue 2.x Specific to Vue 2 usage
Projects
Status: Vue 2
Development

Successfully merging this pull request may close these issues.

Nuxt 2 - using a store in a plugin outputs an error in console
3 participants