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

[@urql/vue] Cannot use useQuery inside of vue-router guard #3731

Open
3 tasks done
leonidk101 opened this issue Jan 6, 2025 · 0 comments
Open
3 tasks done

[@urql/vue] Cannot use useQuery inside of vue-router guard #3731

leonidk101 opened this issue Jan 6, 2025 · 0 comments

Comments

@leonidk101
Copy link

Describe the bug

The setup: There's a pinia store that is used in a router guard, the store uses useQuery composable from @urql/vue

Because it tried to access vue instance in router guard the app returns the following error:

use* functions may only be called during the `setup()` or other lifecycle hooks.

As far as I can see the error comes from

'use* functions may only be called during the `setup()` or other lifecycle hooks.'

Am I doing something wrong?

Reproduction

https://stackblitz.com/edit/vitejs-vite-kudyigng

Urql version

@urql/vue v1.4.2

Validations

  • I can confirm that this is a bug report, and not a feature request, RFC, question, or discussion, for which GitHub Discussions should be used
  • Read the docs.
  • Follow our Code of Conduct
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

1 participant