epicweb-dev / epic-stack

This is a Full Stack app starter with the foundational things setup and configured for you to hit the ground running on your next EPIC idea.
https://www.epicweb.dev/epic-stack
MIT License
4.47k stars 368 forks source link

Found a very strange error(It seems to reload once (twice total) #839

Closed Alvazz closed 1 month ago

Alvazz commented 1 month ago

I followed the standard documentation line by line without adding any additional steps, then ran it, opened the browser to access it, and found that when loading the page, it seemed to reload once (twice in total) and then I saw this error log through the browser console.

image
lsbyerley commented 1 month ago

It's the hydration mismatch error. I've tried to fix this but to no avail. It appears to be coming from the nonce value https://github.com/epicweb-dev/epic-stack/blob/c2e8ed608b27f376b99df97021988c496da2c816/app/root.tsx#L193

This article will give you some context on the issue https://www.jacobparis.com/content/remix-hydration-errors

kentcdodds commented 1 month ago

I've just added a documentation bit about this: https://github.com/epicweb-dev/epic-stack/blob/main/docs/troubleshooting.md#hydration-mismatch

hilja commented 2 weeks ago

The browser strips the nonce from the DOM before executing any JavaScript for security reasons

Great to know! I almost lost my mind debugging this :)