From a06d181af081a17bea466eef2bae1bdaaf8a4b5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Markb=C3=A5ge?= Date: Wed, 25 Sep 2019 08:10:35 -0700 Subject: [PATCH] Include tag in begin/complete invariant (#16881) --- packages/react-reconciler/src/ReactFiberBeginWork.js | 3 ++- packages/react-reconciler/src/ReactFiberCompleteWork.js | 3 ++- scripts/error-codes/codes.json | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/packages/react-reconciler/src/ReactFiberBeginWork.js b/packages/react-reconciler/src/ReactFiberBeginWork.js index f86a7baaff4a..1e613daac5b0 100644 --- a/packages/react-reconciler/src/ReactFiberBeginWork.js +++ b/packages/react-reconciler/src/ReactFiberBeginWork.js @@ -3193,8 +3193,9 @@ function beginWork( } invariant( false, - 'Unknown unit of work tag. This error is likely caused by a bug in ' + + 'Unknown unit of work tag (%s). This error is likely caused by a bug in ' + 'React. Please file an issue.', + workInProgress.tag, ); } diff --git a/packages/react-reconciler/src/ReactFiberCompleteWork.js b/packages/react-reconciler/src/ReactFiberCompleteWork.js index 77dd42dfebd7..0a5f80010c32 100644 --- a/packages/react-reconciler/src/ReactFiberCompleteWork.js +++ b/packages/react-reconciler/src/ReactFiberCompleteWork.js @@ -1285,8 +1285,9 @@ function completeWork( default: invariant( false, - 'Unknown unit of work tag. This error is likely caused by a bug in ' + + 'Unknown unit of work tag (%s). This error is likely caused by a bug in ' + 'React. Please file an issue.', + workInProgress.tag, ); } diff --git a/scripts/error-codes/codes.json b/scripts/error-codes/codes.json index 00edb16006fa..5d0a77745774 100644 --- a/scripts/error-codes/codes.json +++ b/scripts/error-codes/codes.json @@ -155,7 +155,7 @@ "153": "Resuming work not yet implemented.", "154": "We should always have pending or current props. This error is likely caused by a bug in React. Please file an issue.", "155": "An indeterminate component should never have mounted. This error is likely caused by a bug in React. Please file an issue.", - "156": "Unknown unit of work tag. This error is likely caused by a bug in React. Please file an issue.", + "156": "Unknown unit of work tag (%s). This error is likely caused by a bug in React. Please file an issue.", "157": "Invalid type of work. This error is likely caused by a bug in React. Please file an issue.", "158": "There must be pending props for an initial mount. This error is likely caused by a bug in React. Please file an issue.", "159": "There should always be pending or memoized props. This error is likely caused by a bug in React. Please file an issue.",