Skip to content

Commit cb31082

Browse files
committed
add detailed debugging for resumable slots error
1 parent 98f413e commit cb31082

File tree

1 file changed

+38
-4
lines changed

1 file changed

+38
-4
lines changed

packages/next/src/compiled/react-dom-experimental/cjs/react-dom-server.node.production.js

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
*/
1010

1111
"use strict";
12+
13+
console.log('file override react-dom-server.node.production.js')
14+
1215
var util = require("util"),
1316
crypto = require("crypto"),
1417
async_hooks = require("async_hooks"),
@@ -5792,7 +5795,15 @@ function retryNode(request, task) {
57925795
0 < task.replay.nodes.length
57935796
)
57945797
throw Error(
5795-
"Couldn't find all resumable slots by key/index during replaying. The tree doesn't match so React will fallback to client rendering."
5798+
"Couldn't find all resumable slots by key/index during replaying. The tree doesn't match so React will fallback to client rendering. Debug info: " + JSON.stringify({
5799+
component: getComponentNameFromType(type) || "Unknown",
5800+
props: Object.keys(props || {}),
5801+
keyPath: task.keyPath,
5802+
childIndex: task.childIndex,
5803+
replayNodes: task.replay.nodes,
5804+
replaySlots: task.replay.slots,
5805+
pendingTasks: task.replay.pendingTasks
5806+
})
57965807
);
57975808
task.replay.pendingTasks--;
57985809
} catch (x) {
@@ -5883,7 +5894,15 @@ function retryNode(request, task) {
58835894
0 < task.replay.nodes.length
58845895
)
58855896
throw Error(
5886-
"Couldn't find all resumable slots by key/index during replaying. The tree doesn't match so React will fallback to client rendering."
5897+
"Couldn't find all resumable slots by key/index during replaying. The tree doesn't match so React will fallback to client rendering. Debug info: " + JSON.stringify({
5898+
boundaryID: props.rootSegmentID || "Unknown",
5899+
content: typeof content === "string" ? content.substring(0, 100) : typeof content,
5900+
keyPath: task.keyPath,
5901+
childIndex: task.childIndex,
5902+
replayNodes: task.replay.nodes,
5903+
replaySlots: task.replay.slots,
5904+
pendingTasks: task.replay.pendingTasks
5905+
})
58875906
);
58885907
task.replay.pendingTasks--;
58895908
if (0 === props.pendingTasks && 0 === props.status) {
@@ -6064,7 +6083,15 @@ function renderChildrenArray(request, task, children, childIndex) {
60646083
renderChildrenArray(request, task, children, -1);
60656084
if (1 === task.replay.pendingTasks && 0 < task.replay.nodes.length)
60666085
throw Error(
6067-
"Couldn't find all resumable slots by key/index during replaying. The tree doesn't match so React will fallback to client rendering."
6086+
"Couldn't find all resumable slots by key/index during replaying. The tree doesn't match so React will fallback to client rendering. Debug info: " + JSON.stringify({
6087+
arrayIndex: childIndex,
6088+
childrenCount: Array.isArray(children) ? children.length : "not array",
6089+
keyPath: task.keyPath,
6090+
childIndex: task.childIndex,
6091+
replayNodes: task.replay.nodes,
6092+
replaySlots: task.replay.slots,
6093+
pendingTasks: task.replay.pendingTasks
6094+
})
60686095
);
60696096
task.replay.pendingTasks--;
60706097
} catch (x) {
@@ -6829,7 +6856,14 @@ function performWork(request$jscomp$1) {
68296856
0 < task.replay.nodes.length
68306857
)
68316858
throw Error(
6832-
"Couldn't find all resumable slots by key/index during replaying. The tree doesn't match so React will fallback to client rendering."
6859+
"Couldn't find all resumable slots by key/index during replaying. The tree doesn't match so React will fallback to client rendering. Debug info: " + JSON.stringify({
6860+
taskNode: task.node || "Unknown",
6861+
keyPath: task.keyPath,
6862+
childIndex: task.childIndex,
6863+
replayNodes: task.replay.nodes,
6864+
replaySlots: task.replay.slots,
6865+
pendingTasks: task.replay.pendingTasks
6866+
})
68336867
);
68346868
task.replay.pendingTasks--;
68356869
task.abortSet.delete(task);

0 commit comments

Comments
 (0)