{"record":{"id":"b56029066d77a938","repo":"facebook/react","slug":"177","errorCode":"177","errorMessage":"Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue.","messagePattern":"Cannot commit the same tree as before\\. This error is likely caused by a bug in React\\. Please file an issue\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/react-reconciler/src/ReactFiberWorkLoop.js","lineNumber":3616,"sourceCode":"      // Stop any gestures that were committed.\n      if (isGestureRender(lanes)) {\n        stopCommittedGesture(root);\n      }\n    }\n    return;\n  } else {\n    if (__DEV__) {\n      if (lanes === NoLanes) {\n        console.error(\n          'finishedLanes should not be empty during a commit. This is a ' +\n            'bug in React.',\n        );\n      }\n    }\n  }\n\n  if (finishedWork === root.current) {\n    throw new Error(\n      'Cannot commit the same tree as before. This error is likely caused by ' +\n        'a bug in React. Please file an issue.',\n    );\n  }\n\n  if (root === workInProgressRoot) {\n    // We can reset these now that they are finished.\n    workInProgressRoot = null;\n    workInProgress = null;\n    workInProgressRootRenderLanes = NoLanes;\n  } else {\n    // This indicates that the last root we worked on is not the same one that\n    // we're committing now. This most commonly happens when a suspended root\n    // times out.\n  }\n\n  // workInProgressX might be overwritten, so we want\n  // to store it in pendingPassiveX until they get processed","sourceCodeStart":3598,"sourceCodeEnd":3634,"githubUrl":"https://github.com/facebook/react/blob/eafeac097ba51e1eab809c07102126bd5f8e5425/packages/react-reconciler/src/ReactFiberWorkLoop.js#L3598-L3634","documentation":"completeRoot requires the finished work-in-progress tree to differ from root.current — committing the same fiber tree twice would corrupt the alternate double-buffering. finishedWork === root.current means the root's committed tree was handed to commit again (error code 177), typically after lanes were lost or a commit was double-entered. This is an internal invariant (the message says to file an issue), not an application error.","triggerScenarios":"The commit path receiving a finishedWork identical to root.current — e.g. an interleaved update path that resets workInProgress to the current tree, or a double invocation of commitRoot for one finished render.","commonSituations":"Historically reported with interleaved mutations racing sync commits (several fixed GitHub issues); duplicated react-dom copies committing one root; canary regressions in the interleaved-update paths.","solutions":["Upgrade to the latest release — this invariant has had multiple fixed regressions","Verify a single react-dom instance owns the root (dedupe packages, no dual bundling of the renderer)","Isolate the trigger (often an update during commit or an interruption pattern) and file a React issue with the repro"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"import * as React from 'react';\nimport * as ReactDOM from 'react-dom/client';\nconsole.assert(React.version === ReactDOM.version, 'version mismatch');\n// also assert only one copy exists at runtime:\nconsole.assert(Object.keys(window).filter((k) => k.startsWith('__REACT_DEVTOOLS')).length <= 1);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Ensure one react-dom instance owns each root — dedupe the dependency tree","Upgrade regularly; this invariant covers several historically fixed commit races","Note the exact steps (often update-during-commit) when filing the issue"],"tags":["internal-invariant","commit","double-commit"],"backgroundTag":"react-internal-invariant","analyzedSha":"eafeac097ba51e1eab809c07102126bd5f8e5425","analyzedAt":"2026-08-21T22:01:08.818Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}