-
Notifications
You must be signed in to change notification settings - Fork 46.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hydration mismatch error: suggestion to include mismatch details in production error message #24850
Comments
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment! |
bump |
This issue has been automatically marked as stale. If this issue is still affecting you, please leave any comment (for example, "bump"), and we'll keep it open. We are sorry that we haven't been able to prioritize it yet. If you have any new additional information, please include it with your comment! |
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please create a new issue with up-to-date information. Thank you! |
After upgrading to React 18 at Unsplash, we saw lots of hydration mismatch errors in production. This was not surprising because React now logs these as errors whereas before they were development-only warnings.
However, when we looked at the errors in Sentry, there was no information in the error message to help us reproduce the problem. It seemed that the mismatches only occurred in very specific circumstances.
React does log this useful information but unfortunately it's only logged in the development build:
react/packages/react-dom/src/client/ReactDOMComponent.js
Lines 234 to 248 in 229c86a
We made a small patch to
react-dom
to add the same information to the production error message. This made it easy to see that the issue was because our date formatting produced different results depending on the user's time zone:I would like to suggest that this information is included in the production error message—presumably this would be useful debugging information for others React users.
Related discussion: #11189
The text was updated successfully, but these errors were encountered: