Hydration node mismatch when using layouts #17011
-
Hey everyone! I have run into a problem when using I have a
I have created a reproduction repo that highlights my problem - https://github.com/andynoir/nuxt3-fetching-question In the repo you will find a In The Has anyone experienced same problem ? Best regards, |
Beta Was this translation helpful? Give feedback.
Replies: 0 comments 7 replies
-
This is a common SSR gotcha. The issue is that on SSR, Vue renders the HTML from top to bottom, outside to inside. And if you only fetch some data as you are rendering the 'inner' part of the page, it doesn't rerender the layout at the top of the page. (On client-side it's fine as can be reactive.) So if you have a common piece you rely on for rendering your page, make sure to fetch it in the layout, a plugin, or a middleware - somewhere outside of the rendering process. https://github.com/nuxt/framework/issues/5669#issuecomment-1173538894 |
Beta Was this translation helpful? Give feedback.
-
This is a common SSR gotcha. The issue is that on SSR, Vue renders the HTML from top to bottom, outside to inside. And if you only fetch some data as you are rendering the 'inner' part of the page, it doesn't rerender the layout at the top of the page. (On client-side it's fine as can be reactive.) So if you have a common piece you rely on for rendering your page, make sure to fetch it in the layout, a plugin, or a middleware - somewhere outside of the rendering process. https://github.com/nuxt/framework/issues/5669#issuecomment-1173538894 |
Beta Was this translation helpful? Give feedback.
-
I don't know if you solved it already or if my solution solves it, Vuetify
When hitting index page, everything was rendering, but when I clicked on profile button on a After a while researching and thinking, I tried a solution that worked for me in a Vite + Vue 3 + Vue Router project: setting the Hope it helps, wishing you health and success! |
Beta Was this translation helpful? Give feedback.
This is a common SSR gotcha. The issue is that on SSR, Vue renders the HTML from top to bottom, outside to inside. And if you only fetch some data as you are rendering the 'inner' part of the page, it doesn't rerender the layout at the top of the page. (On client-side it's fine as can be reactive.) So if you have a common piece you rely on for rendering your page, make sure to fetch it in the layout, a plugin, or a middleware - somewhere outside of the rendering process.
https://github.com/nuxt/framework/issues/5669#issuecomment-1173538894