Skip to content

Commit a06d181

Browse files
authored
Include tag in begin/complete invariant (#16881)
1 parent 0d8c0cd commit a06d181

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

packages/react-reconciler/src/ReactFiberBeginWork.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3193,8 +3193,9 @@ function beginWork(
31933193
}
31943194
invariant(
31953195
false,
3196-
'Unknown unit of work tag. This error is likely caused by a bug in ' +
3196+
'Unknown unit of work tag (%s). This error is likely caused by a bug in ' +
31973197
'React. Please file an issue.',
3198+
workInProgress.tag,
31983199
);
31993200
}
32003201

packages/react-reconciler/src/ReactFiberCompleteWork.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1285,8 +1285,9 @@ function completeWork(
12851285
default:
12861286
invariant(
12871287
false,
1288-
'Unknown unit of work tag. This error is likely caused by a bug in ' +
1288+
'Unknown unit of work tag (%s). This error is likely caused by a bug in ' +
12891289
'React. Please file an issue.',
1290+
workInProgress.tag,
12901291
);
12911292
}
12921293

scripts/error-codes/codes.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@
155155
"153": "Resuming work not yet implemented.",
156156
"154": "We should always have pending or current props. This error is likely caused by a bug in React. Please file an issue.",
157157
"155": "An indeterminate component should never have mounted. This error is likely caused by a bug in React. Please file an issue.",
158-
"156": "Unknown unit of work tag. This error is likely caused by a bug in React. Please file an issue.",
158+
"156": "Unknown unit of work tag (%s). This error is likely caused by a bug in React. Please file an issue.",
159159
"157": "Invalid type of work. This error is likely caused by a bug in React. Please file an issue.",
160160
"158": "There must be pending props for an initial mount. This error is likely caused by a bug in React. Please file an issue.",
161161
"159": "There should always be pending or memoized props. This error is likely caused by a bug in React. Please file an issue.",

0 commit comments

Comments
 (0)