{"record":{"id":"d293a4b8a5bb139e","repo":"facebook/react","slug":"414","errorCode":"414","errorMessage":"Did not expect this call in production. This is a bug in React. Please file an issue.","messagePattern":"Did not expect this call in production\\. This is a bug in React\\. Please file an issue\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/react-reconciler/src/ReactFiberBeginWork.js","lineNumber":3932,"sourceCode":"      prevSibling.sibling = newWorkInProgress;\n    }\n\n    // Delete the old fiber and place the new one.\n    // Since the old fiber is disconnected, we have to schedule it manually.\n    const deletions = returnFiber.deletions;\n    if (deletions === null) {\n      returnFiber.deletions = [current];\n      returnFiber.flags |= ChildDeletion;\n    } else {\n      deletions.push(current);\n    }\n\n    newWorkInProgress.flags |= Placement | PlacementDEV;\n\n    // Restart work from the new fiber.\n    return newWorkInProgress;\n  } else {\n    throw new Error(\n      'Did not expect this call in production. ' +\n        'This is a bug in React. Please file an issue.',\n    );\n  }\n}\n\nfunction checkScheduledUpdateOrContext(\n  current: Fiber,\n  renderLanes: Lanes,\n): boolean {\n  // Before performing an early bailout, we must check if there are pending\n  // updates or context.\n  const updateLanes = current.lanes;\n  if (includesSomeLane(updateLanes, renderLanes)) {\n    return true;\n  }\n  // No pending update, but because context is propagated lazily, we need\n  // to check for a context change before we bail out.","sourceCodeStart":3914,"sourceCodeEnd":3950,"githubUrl":"https://github.com/facebook/react/blob/eafeac097ba51e1eab809c07102126bd5f8e5425/packages/react-reconciler/src/ReactFiberBeginWork.js#L3914-L3950","documentation":"remountFiber() rebuilds a subtree by swapping in a new work-in-progress fiber, marking the old one for deletion, and restarting work - behavior used by DevTools force-remount and DEV-only recovery paths. Its body runs only under if (__DEV__); the else branch guarantees a production bundle never calls it. This throw in production means __DEV__ was evaluated inconsistently across the bundle: a call site compiled in DEV mode reached a helper compiled in prod mode.","triggerScenarios":"A production bundle where the bundler defines NODE_ENV/__DEV__ per-chunk instead of globally; importing a development React entry point in one chunk and the production artifact in another; custom bundler aliases resolving some react imports to react.development.js.","commonSituations":"Monorepos where one package builds React in dev mode and another consumes the prod artifact; staging builds shipped with mixed mode; SSR bundles mixing node-development and browser-production React; hand-rolled React builds with broken defines.","solutions":["Set NODE_ENV once, globally, for the whole build and rebuild from a clean cache","Run npm ls react react-dom and remove duplicate or mismatched copies","Check bundler aliases - every react/react-dom import must resolve to the same production artifact","If you maintain a custom React build, verify __DEV__ is replaced with false everywhere in the prod output"],"exampleFix":"// before - per-entry define (can disagree across chunks)\ndefine: { 'process.env.NODE_ENV': JSON.stringify(mode) }\n\n// after - one global define for the entire production build\ndefine: { 'process.env.NODE_ENV': JSON.stringify('production') }","handlingStrategy":"validation","validationCode":"# Build-time validation: no development React artifacts may ship\n! grep -rl \"Remount failed\" dist/ 2>/dev/null | grep -q . \\\n  || { echo 'dev React branch in bundle - rebuild with NODE_ENV=production'; exit 1; }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Define NODE_ENV once, globally, for the entire build","Alias react and react-dom to a single resolved artifact","Add a CI check that greps the production bundle for development-only React strings"],"tags":["build-config","dev-only","fiber","invariant","node-env"],"backgroundTag":"dev-prod-build-mismatch","analyzedSha":"eafeac097ba51e1eab809c07102126bd5f8e5425","analyzedAt":"2026-08-21T22:01:08.818Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}