#Error ~ Hydration failed because the initial UI does not match what was rendered on the server

9 messages · Page 1 of 1 (latest)

hexed basin
#

Hydration failed because the initial UI does not match what was rendered on the server.
There was an error while hydrating. Because the error happened outside of a Suspense boundary, the entire root will switch to client rendering.

I built the following twitter clone from youtube and it works perfectly in dev but fails after deploying to netlify. I just did default settings there and followed my normal flow for SSGs (11ty/Astro); this is my first meaningful Next.js app and first with SSR. I don't really know how to diagnose the problem since it's only happening in production 🙃 any advice would be appreciated!

[https://youtu.be/rCselwxbUgA]

I asked Sanity to hook up some free stuff for this video... They made a custom 🔥 boosted free plan 👉 https://www.sanity.io/sonny

❗️Join the world’s BEST developer community “Zero to Full Stack Hero” NOW: https://www.papareact.com/course

❗️❗️ Watch my REACT BASICS 101 class for FREE with 1 month FREE Skillshare access (First 1000 people): http...

▶ Play video
final junco
#

Check that your html is valid

#

Also are you generating something like random numbers or getting the current time stamp somewhere?

#

Doing so incorrectly could also lead to this error

hexed basin
#

ended up being that I was using local env and needed to add them to netlify

#

but now the problem is that I don't know how to access my sanity.io backend for the production build

#

I got bugs in my comments and feed updating but I need to figure out how to access the live backend

#

I've only ever done SSGs with netlify cms so since that's github based it's a different flow obv but also it's just updated to what your repo has ya know