{"record":{"id":"8e8f3f5b9242fe55","repo":"facebook/react","slug":"163","errorCode":"163","errorMessage":"This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.","messagePattern":"This unit of work tag should not have side-effects\\. This error is likely caused by a bug in React\\. Please file an issue\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/react-reconciler/src/ReactFiberCommitWork.js","lineNumber":572,"sourceCode":"            // This is a new mount. We should have handled this as part of the\n            // Placement effect or it is deeper inside a entering transition.\n          } else {\n            // Something may have mutated within this subtree. This might need to cause\n            // a cross-fade of this parent. We first assign old names to the\n            // previous tree in the before mutation phase in case we need to.\n            // TODO: This walks the tree that we might continue walking anyway.\n            // We should just stash the parent ViewTransitionComponent and continue\n            // walking the tree until we find HostComponent but to do that we need\n            // to use a stack which requires refactoring this phase.\n            commitBeforeUpdateViewTransition(current, finishedWork);\n          }\n        }\n        break;\n      }\n    // Fallthrough\n    default: {\n      if ((flags & Snapshot) !== NoFlags) {\n        throw new Error(\n          'This unit of work tag should not have side-effects. This error is ' +\n            'likely caused by a bug in React. Please file an issue.',\n        );\n      }\n    }\n  }\n}\n\nfunction commitBeforeMutationEffectsDeletion(\n  deletion: Fiber,\n  isViewTransitionEligible: boolean,\n) {\n  if (enableCreateEventHandleAPI) {\n    // TODO (effects) It would be nice to avoid calling doesFiberContain()\n    // Maybe we can repurpose one of the subtreeFlags positions for this instead?\n    // Use it to store which part of the tree the focused instance is in?\n    // This assumes we can safely determine that instance during the \"render\" phase.\n    if (doesFiberContain(deletion, focusedInstanceHandle as any as Fiber)) {","sourceCodeStart":554,"sourceCodeEnd":590,"githubUrl":"https://github.com/facebook/react/blob/eafeac097ba51e1eab809c07102126bd5f8e5425/packages/react-reconciler/src/ReactFiberCommitWork.js#L554-L590","documentation":"commitBeforeMutationEffectsOnFiber() handles pre-mutation snapshot work. Only class components (getSnapshotBeforeUpdate) and HostRoot (container reset) legitimately carry the Snapshot flag; the default branch treats Snapshot on any other tag as an impossible state and throws.","triggerScenarios":"React internal bugs where the Snapshot bit lands on a non-class, non-root fiber - historically associated with dehydrated Suspense boundaries and with new fiber tags landing before their before-mutation handling. No public API sets Snapshot directly.","commonSituations":"Canary builds after new component types shipped (ViewTransition, Activity); SSR hydration where snapshot work interleaves with dehydration; errors that appear immediately after a React upgrade.","solutions":["Update React to the latest patch/canary - flag-assignment bugs of this kind are fixed quickly","Bisect the React version: if the error started right after an upgrade, report it against that release","Reduce the repro by toggling getSnapshotBeforeUpdate usage and file an issue","As a workaround, replace getSnapshotBeforeUpdate on the affected subtree with logic that avoids snapshots"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"Before-mutation-phase throw: not catchable by ErrorBoundaries. Log via onUncaughtError with the component stack and React version, report, and remount the root.","preventionTips":["Pin React versions and upgrade deliberately rather than floating ranges","If you use getSnapshotBeforeUpdate, test hydration paths explicitly after upgrades","Keep a single React copy in the bundle so flag semantics cannot diverge"],"tags":["commit-phase","snapshot","class-components","invariant"],"backgroundTag":"react-internal-invariant","analyzedSha":"eafeac097ba51e1eab809c07102126bd5f8e5425","analyzedAt":"2026-08-21T22:01:08.818Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}