Next.js Discord

Discord Forum

Hydration failed

Answered
Cornish Rex posted this in #help-forum
Open in Discord
Cornish RexOP
Hello guys, i keep getting hydration failed, im not sure whats causing it or where it is happening my best guess is this?
Error: Hydration failed because the initial UI does not match what was rendered on the server.
Warning: Expected server HTML to contain a matching <li> in <a>.
See more info here: https://nextjs.org/docs/messages/react-hydration-error


<div className="w-full flex justify-center items-center">
      <Link className='bg-red-600 font-normal text-white px-6 py-2' href={"/shop"}>
           the-{name}
      </Link>
</div>

how can i know where the issue is happening exactly?
the call stack just shows:
Call Stack
throwOnHydrationMismatch
node_modules\next\dist\compiled\react-dom\cjs\react-dom.development.js (7088:8)
throwOnHydrationMismatch
node_modules\next\dist\compiled\react-dom\cjs\react-dom.development.js (7117:6)
workInProgress
node_modules\next\dist\compiled\react-dom\cjs\react-dom.development.js (16524:37)
updateHostComponent$1
node_modules\next\dist\compiled\react-dom\cjs\react-dom.development.js (18427:13)
Answered by Cornish Rex
Was a dumb mistake, was having 2 links inside of each others! it happens 🙂
View full answer

1 Reply

Cornish RexOP
Was a dumb mistake, was having 2 links inside of each others! it happens 🙂
Answer