epic-stack icon indicating copy to clipboard operation
epic-stack copied to clipboard

Fix hydration warning on script nonces

Open aon opened this issue 1 year ago • 4 comments

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

image

Test Plan

Checklist

  • [ ] Tests updated
  • [ ] Docs updated

Screenshots

aon avatar Jul 02 '24 15:07 aon

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

image

kentcdodds avatar Jul 02 '24 18:07 kentcdodds

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

aon avatar Jul 02 '24 18:07 aon

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.

kentcdodds avatar Jul 02 '24 18:07 kentcdodds

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.

aon avatar Jul 02 '24 18:07 aon

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

kentcdodds avatar Aug 27 '24 15:08 kentcdodds