You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Is your feature request related to a problem? Please describe.
It is related to issue #8620 ("beforeNuxtRender is called too soon").
Since Vue’s serverPrefetch (onServerPrefetch) and Nuxt’s new fetch (which utilizes Vue’s serverPrefetch) were introduced, beforeNuxtRender is no longer the proper hook for plugins to inject their state into nuxtState.
Some plugins such as vue-apollo currently rely on serverPrefetch (onServerPrefetch) to perform the component-level prefetching, and therefore these plugins cannot do the client hydration properly with the current Nuxt.
Some users seems to do a temporary hack as a workaround #8852 (comment).
Describe the solution you'd like
I think Nuxt should provide plugins with a new hook that is suitable for updating nuxtState.
Describe alternatives you've considered
Instead of adding a new hook, we could make Nuxt call beforeNuxtRender() just after the App is rendered if this doesn't cause serious backward compatibility issues.
The text was updated successfully, but these errors were encountered:
Is your feature request related to a problem? Please describe.
It is related to issue #8620 ("beforeNuxtRender is called too soon").
Since Vue’s
serverPrefetch
(onServerPrefetch
) and Nuxt’s new fetch (which utilizes Vue’s serverPrefetch) were introduced,beforeNuxtRender
is no longer the proper hook for plugins to inject their state intonuxtState
.Nuxt < 2.12
→ asyncData() & fetch() → beforeNuxtRender() → start rendering App → serverPrefetch() → render HTML
Nuxt >= 2.12
→ asyncData() → beforeNuxtRender() → start rendering App → serverPrefetch() → fetch() → render HTML
Some plugins such as vue-apollo currently rely on
serverPrefetch
(onServerPrefetch) to perform the component-level prefetching, and therefore these plugins cannot do the client hydration properly with the current Nuxt.Some users seems to do a temporary hack as a workaround #8852 (comment).
Describe the solution you'd like
I think Nuxt should provide plugins with a new hook that is suitable for updating
nuxtState
.Describe alternatives you've considered
Instead of adding a new hook, we could make Nuxt call beforeNuxtRender() just after the App is rendered if this doesn't cause serious backward compatibility issues.
The text was updated successfully, but these errors were encountered: