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.32k stars 355 forks source link

Fix hydration warning on script nonces #787

Closed aon closed 1 week ago

aon commented 2 months ago

This PR just fixes the annoying hydration warning that appears on Firefox on script nonces:

image

Test Plan

Checklist

Screenshots

kentcdodds commented 2 months ago

I can't reproduce this issue with https://www.epicstack.dev using firefox.

image
aon commented 2 months ago

I can't either, strange. But on dev mode the message is indeed there. Can you try it on a local environment?

kentcdodds commented 2 months ago

Ah yes, I can reproduce it locally. I'll have to look into it a bit more later. I don't like using this attribute because it just hides the problem, but it may not fix the problem.

aon commented 2 months ago

It does not indeed fix the problem. I've been reading your issues raised on the React repository and there doesn't seem to be a good solution so far. I implement this on my own projects because I couldn't think of any hydration issue that could arise on these scripts, and to prevent having errors in the console tab. Although I do agree with your statement above.

kentcdodds commented 1 week ago

More on this here: https://github.com/epicweb-dev/epic-stack/discussions/768