Next.js Discord

Discord Forum

Hydration Error

Unanswered
shadow posted this in #help-forum
Open in Discord
Hey devs, im having some hydratation errors, but for i still cant understand what hydration errors means and what are the causes.
The error is saying that the error is on client component but i suspect that is when im rendering the component.

16 Replies

you can't put a div inside an a
@riský you can't put a `div` inside an `a`
Link is a tag right?
yeah
so the problem is that Link where the component is rendered?
you can't nest a div inside a link...
so just see where you use Link and add a div
and try and fix 🙂
hmm okay thanks!
it is kinda a weird message i know 😭
but because somewhere (server or client) follows spec, the other is diferent and thus error
it his, now im tryna figure it out solve this mess
i removed that link where the component is rendered and the hydration error disappear
yeah makes sense
let me know when/if you properly fix this
if you wan't a easy fix, you can make the a a div and have onclick with useRouter.push, but please try and actually fix (as seo and lots of features worse)
yea i will see what can i do