-
-
Notifications
You must be signed in to change notification settings - Fork 981
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(nuxt): plugin injection on latest Nuxt 3 context #1433
Conversation
✅ Deploy Preview for pinia-official canceled.
|
Thanks, I will take a look. I think we will also need to migrate to nuxt/kit. It was removed in the past due to some missing features but it should be ready now |
Nuxt kit is now stable to migrate to but buntime part (of plugins) can be upgraded to bridge. Kit utils are only for module/build level not runtime. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks. Let's go with this for the moment as it works with Nuxt2,3 and bridge
This comment was marked as spam.
This comment was marked as spam.
context.ssrContext.payload.pinia = pinia.state.value | ||
} | ||
} else { | ||
const source = isVue2 ? context.nuxtState : context.payload |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Was this change necessary? 🤔
It created other problems: #1447
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because nuxtState is removed in Nuxt 3 nuxt/framework#5630
It's weird that I didn't get error when set ssr: false
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok, thanks
In Nuxt 3, I can get to In components, I usually just do: const nuxtApp = useNuxtApp();
const authUser = nuxtApp.$auth.user; but in a
Is this issue the reason - change in context access? Reference: Denoder/nuxt-module-alternatives#54 |
As Nuxt 3 removed the legacy context (nuxt/framework#5630), the
inject
argument andnuxtState
option is not available anymore.Fixes #1428
fix #1432