{"record":{"id":"8c66ea5a72d48ab3","repo":"facebook/react","slug":"559","errorCode":"559","errorMessage":"Expected to find a host node. This is a bug in React.","messagePattern":"Expected to find a host node\\. This is a bug in React\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/react-native-renderer/src/ReactFiberConfigFabric.js","lineNumber":358,"sourceCode":"  // React resets all the fields in the fiber when the component is unmounted\n  // to prevent memory leaks.\n  if (instance == null) {\n    return null;\n  }\n\n  if (internalInstanceHandle.tag === HostText) {\n    const textInstance: TextInstance = instance;\n    return getPublicTextInstance(textInstance, internalInstanceHandle);\n  }\n\n  const elementInstance: Instance = internalInstanceHandle.stateNode;\n  return getPublicInstance(elementInstance);\n}\n\nfunction getPublicInstanceFromHostFiber(fiber: Fiber): PublicInstance {\n  const publicInstance = getPublicInstance(fiber.stateNode);\n  if (publicInstance === null) {\n    throw new Error('Expected to find a host node. This is a bug in React.');\n  }\n  return publicInstance;\n}\n\nexport function prepareForCommit(containerInfo: Container): null | Object {\n  // Noop\n  return null;\n}\n\nexport function resetAfterCommit(containerInfo: Container): void {\n  // Noop\n}\n\nexport function shouldSetTextContent(type: string, props: Props): boolean {\n  // TODO (bvaughn) Revisit this decision.\n  // Always returning false simplifies the createInstance() implementation,\n  // But creates an additional child Fiber for raw text children.\n  // No additional native views are created though.","sourceCodeStart":340,"sourceCodeEnd":376,"githubUrl":"https://github.com/facebook/react/blob/eafeac097ba51e1eab809c07102126bd5f8e5425/packages/react-native-renderer/src/ReactFiberConfigFabric.js#L340-L376","documentation":"In the Fabric host config, getPublicInstanceFromHostFiber asserts that a host-component fiber's stateNode resolves to a public host instance; a null result breaks the renderer's own invariant and surfaces as 'Expected to find a host node. This is a bug in React.' It backs host-instance lookup paths used by findHostInstance-style APIs and tooling.","triggerScenarios":"Host-fiber traversal (inspector data collection, findHostInstance, DevTools) hitting a host fiber whose stateNode currently has no public instance - for example a tree inspected mid-commit, right as a screen unmounts, or under version-skewed tooling poking fibers directly.","commonSituations":"react vs react-native version skew; DevTools inspecting during animations or navigation transitions; experimental RN builds where instance lifecycles changed.","solutions":["Align react, react-native, and DevTools to a supported version trio.","Retry the inspection after the tree settles (next frame or after the transition completes).","If it reproduces on matched versions, file an issue with the component stack - the message marks a renderer invariant."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"let data;\ntry {\n  data = getInspectorDataForInstance(fiber);\n} catch (e) {\n  if (/Expected to find a host node/.test(e.message)) {\n    await new Promise(resolve => requestAnimationFrame(resolve)); // let the commit settle\n    data = getInspectorDataForInstance(fiber);\n  } else {\n    throw e;\n  }\n}","preventionTips":["Align react, react-native, and DevTools versions.","Avoid inspecting during navigation transitions or fast commits.","Report reproducible invariant hits with a component stack - the message marks a renderer bug."],"tags":["react-native","fabric","host-instance","invariant","inspector"],"backgroundTag":"host-instance-missing","analyzedSha":"eafeac097ba51e1eab809c07102126bd5f8e5425","analyzedAt":"2026-08-21T22:01:08.818Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}