Skip to content

Commit ac628d5

Browse files
committed
Ignore error if content node is gone
1 parent 49ea8bf commit ac628d5

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

packages/react-dom-bindings/src/server/fizz-instruction-set/ReactDOMFizzInstructionSetInlineCodeStrings.js

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/react-dom-bindings/src/server/fizz-instruction-set/ReactDOMFizzInstructionSetShared.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,12 @@ export function clientRenderBoundary(
4949

5050
export function completeBoundary(suspenseBoundaryID, contentID, errorDigest) {
5151
const contentNode = document.getElementById(contentID);
52+
if (!contentNode) {
53+
// If the client has failed hydration we may have already deleted the streaming
54+
// segments. The server may also have emitted a complete instruction but cancelled
55+
// the segment. Regardless we can ignore this case.
56+
return;
57+
}
5258
// We'll detach the content node so that regardless of what happens next we don't leave in the tree.
5359
// This might also help by not causing recalcing each time we move a child from here to the target.
5460
contentNode.parentNode.removeChild(contentNode);

0 commit comments

Comments
 (0)