Skip to content

Commit c9d0167

Browse files
committed
Adjust error overlay impl now that React removed the "Warning: " prefix
1 parent 7c4809c commit c9d0167

File tree

1 file changed

+9
-9
lines changed

1 file changed

+9
-9
lines changed

Diff for: packages/next/src/client/components/react-dev-overlay/internal/helpers/hydration-error-info.ts

+9-9
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,19 @@ export const hydrationErrorState: HydrationErrorState = {}
1717

1818
// https://github.com/facebook/react/blob/main/packages/react-dom/src/__tests__/ReactDOMHydrationDiff-test.js used as a reference
1919
const htmlTagsWarnings = new Set([
20-
'Warning: In HTML, %s cannot be a child of <%s>.%s\nThis will cause a hydration error.%s',
21-
'Warning: In HTML, %s cannot be a descendant of <%s>.\nThis will cause a hydration error.%s',
22-
'Warning: In HTML, text nodes cannot be a child of <%s>.\nThis will cause a hydration error.',
23-
"Warning: In HTML, whitespace text nodes cannot be a child of <%s>. Make sure you don't have any extra whitespace between tags on each line of your source code.\nThis will cause a hydration error.",
24-
'Warning: Expected server HTML to contain a matching <%s> in <%s>.%s',
25-
'Warning: Did not expect server HTML to contain a <%s> in <%s>.%s',
20+
'In HTML, %s cannot be a child of <%s>.%s\nThis will cause a hydration error.%s',
21+
'In HTML, %s cannot be a descendant of <%s>.\nThis will cause a hydration error.%s',
22+
'In HTML, text nodes cannot be a child of <%s>.\nThis will cause a hydration error.',
23+
"In HTML, whitespace text nodes cannot be a child of <%s>. Make sure you don't have any extra whitespace between tags on each line of your source code.\nThis will cause a hydration error.",
24+
'Expected server HTML to contain a matching <%s> in <%s>.%s',
25+
'Did not expect server HTML to contain a <%s> in <%s>.%s',
2626
])
2727
const textAndTagsMismatchWarnings = new Set([
28-
'Warning: Expected server HTML to contain a matching text node for "%s" in <%s>.%s',
29-
'Warning: Did not expect server HTML to contain the text node "%s" in <%s>.%s',
28+
'Expected server HTML to contain a matching text node for "%s" in <%s>.%s',
29+
'Did not expect server HTML to contain the text node "%s" in <%s>.%s',
3030
])
3131
const textMismatchWarning =
32-
'Warning: Text content did not match. Server: "%s" Client: "%s"%s'
32+
'Text content did not match. Server: "%s" Client: "%s"%s'
3333

3434
export const getHydrationWarningType = (
3535
msg: NullableText

0 commit comments

Comments
 (0)