I built a site with Nuxt 3 hosted on Netlify which in general works like a charm
But recently I get weird errors in the deploy preview.
For example in the deploy preview my footer is doubled, but live it is fine:
This is a tat bit unnerving because I can’t tell beforehand if it is an error which also will go live.
Has anyone experienced something similar and can point me in a direction in how to solve this.
Thanks in advance!
Yeah, this is a weird one. I have a theory as to why this is happening, but no explanation why this won’t happen on production. There’s a big difference between your deploy preview and the production build though.
While the pages appear visually similar, under-the-hood there seem to be major differences. The PR build for example, seems to request just 1 JS file, but the production one somehow requests more of those before
@hrishikesh Thank you for looking into it.
Regarding everything deploy I rely on what I get with Nuxt 3 and Netlify and it seems with that combination something is off.
Is that an issue to bring up with the developers from Nuxt 3 or with you at Netlify?
@hrishikesh I don’t know exactly what changed but now the problem also occurs on production.
I reset my changes from today to the last commit which worked but the deploy still has the mentioned problems:
This is the last deploy which worked:
Any hint on how to prevent this is much appreciated because at the moment we are not able to deploy anything.
I created a less complicated test repository:
And the same problems occur:
Thanks for sharing the reproduction. I’m still not sure how this is something Netlify would be causing - at the same time, cannot explain the weird behaviour. All I can see is, from Netlify’s end, this appears to be a code that the developer and Nuxt is generating and Netlify is simply executing.
To me it appears that, Nuxt is rendering the content on the server and in its “hydration” step, it’s adding the same content for some reason. Does this happen across various Nuxt versions?
I just downgraded Nuxt to RC1 and the same error occurs.
What I don’t get is that the last time it worked I was using RC4 and for some reason it seems now every deploy is “failing”.
@hrishikesh The problem seems to be nuxt related: Hydration issue with Netlify deployments · Issue #6204 · nuxt/framework · GitHub.
For now there is a workaround which fixes this weird behaviour.
Hey there, @stefanfrede
Thanks so much for coming back and letting us know. This will be beneficial to future explorers who encounter something similar.