-
Notifications
You must be signed in to change notification settings - Fork 47.6k
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
Print server nodes for hydration mismatch #24159
Conversation
@@ -156,9 +169,15 @@ if (__DEV__) { | |||
JSON.stringify(normalizedServerValue), | |||
JSON.stringify(normalizedClientValue), | |||
); | |||
if (!isJsdomDev) { | |||
console['error']('Server HTML:', domElement); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Untransformed because we don't want Warning:
prefix or component stack.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess DevTools adds component stack anyway.
@@ -156,9 +169,15 @@ if (__DEV__) { | |||
JSON.stringify(normalizedServerValue), | |||
JSON.stringify(normalizedClientValue), | |||
); | |||
if (!isJsdomDev) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
They're pretty noisy in Node environment because it starts printing fibers due to the reference inside. Plus not very helpful anyway. Not sure if there's a better way to detect.
Comparing: 4072bdf...0f4f924 Critical size changesIncludes critical production bundles, as well as any change greater than 2%:
Significant size changesIncludes any change greater than 0.2%: (No significant changes) |
So this works, but I think the messages need some tweaking so that the context is clearer. Especially for the "expected A, found B" kind of thing where the current message feels misleading/missing info even with the parent node. It needs the child node as well. |
Similar in spirit to #22786.
Haven't tested if it works yet.