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

Pinia is not injected before vue-router beforeEach #1436

Closed
BenShelton opened this issue Jul 8, 2022 · 1 comment
Closed

Pinia is not injected before vue-router beforeEach #1436

BenShelton opened this issue Jul 8, 2022 · 1 comment

Comments

@BenShelton
Copy link
Contributor

BenShelton commented Jul 8, 2022

Reproduction

https://stackblitz.com/edit/github-ddb6tb?file=src/main.ts

Steps to reproduce the bug

  1. Install Pinia & Vue Router
  2. Add a beforeEach on the router instance that uses a store
  3. Check console on startup

Expected behavior

No warnings appear

Actual behavior

Warning about injection symbol appears. See screenshot (the toRefs warning appears unrelated):

Screenshot 2022-07-08 at 14 42 02

Additional information

This is a minimal example of what we have already had running for a long time in production. Since upgrading to Vue 2.7 this warning has started to appear with no other code changes.

Workaround is adding an await nextTick() in the start of the router guard which makes the error disappear.

@posva
Copy link
Member

posva commented Jul 8, 2022

Duplicate of vuejs/vue#12636

@posva posva marked this as a duplicate of vuejs/vue#12636 Jul 8, 2022
@posva posva closed this as completed Jul 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants