generated from Hebilicious/nuxt-module-template
-
-
Notifications
You must be signed in to change notification settings - Fork 5
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
Unable to use in composable #72
Comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Environment
Reproduction
composables/useQueryWrapper.ts
plugins/03.auth-redirect.ts
Describe the bug
Hi! Thanks for all your great work on this plugin :)
I'm struggling with just one specific implementation.
useQueryWrapper
in the setup block of one of my pages.useQueryWrapper
in my Pinia store (I <3 Pinia, but I'm tryna replace it withvue-query
, so I'm really only callinguseQueryWrapper
from inside pinia as a test...)In my my authStore.ts (pinia), I can successfully do this:
useQueryWrapper
from inside the global middleware I create in the plugin I've shared above.If I could, I'd implement that whole plugin differently, but this is the specific way that the AWS Amplify documentation insists that we implement a routeGuard with SSR + Nuxt3 + Amplify.
I did do lots of digging and searching, and I found this: TanStack/query#5533
I don't understand how we're not getting any context from inside a plugin...I'm just confused (and probably a bit of a newb).
Based on that discussion, I even tried to do
useNuxtApp().runWithContext(async () => await useQueryWrapper())
from inside the03.auth-redirect.ts
plugin.I'm totally stuck. Would you happen to have any suggestion or idea as to how I can get this working. I'm sure that I'm missing something stupid/ovious, but it's 4AM here and I'm already starting to lose it 😂
Thank you for any help or direction you may be able to provide! 🙌🏼
Additional context
No response
Logs
The text was updated successfully, but these errors were encountered: