{"record":{"id":"5f4478eec914aad6","repo":"vercel-labs/agent-browser","slug":"no-react-renderer-attached","errorCode":null,"errorMessage":"No React renderer attached","messagePattern":"No React renderer attached","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/src/native/react/scripts.rs","lineNumber":143,"sourceCode":"      let j = i + 2;\n      for (let c = 0; c < ops[i + 1]; c++) j += 5 + ops[j + 4];\n      return j - i;\n    }\n  });\n\n  return JSON.stringify(nodes);\n})()\n\"#;\n\n/// Template for `inspect` — replace {{ID}} with the numeric fiber id.\npub const TREE_INSPECT: &str = r#\"\n(() => {\n  const id = {{ID}};\n  const hook = window.__REACT_DEVTOOLS_GLOBAL_HOOK__;\n{{PICK_RI}}\n  const __abRiId = __abPickReactRendererId(hook);\n  const ri = (__abRiId != null && hook.rendererInterfaces && hook.rendererInterfaces.get) ? hook.rendererInterfaces.get(__abRiId) : null;\n  if (!ri) throw new Error(\"No React renderer attached\");\n  if (!ri.hasElementWithId(id)) throw new Error(\"element \" + id + \" not found (page reloaded?)\");\n  const result = ri.inspectElement(__abRiId, id, null, true);\n  if (!result || result.type !== \"full-data\") {\n    throw new Error(\"inspect failed: \" + (result && result.type));\n  }\n  const v = result.value;\n  const name = ri.getDisplayNameForElementID(id);\n  const lines = [name + \" #\" + id];\n  if (v.key != null) lines.push(\"key: \" + JSON.stringify(v.key));\n  section(\"props\", v.props);\n  section(\"hooks\", v.hooks);\n  section(\"state\", v.state);\n  section(\"context\", v.context);\n  if (v.owners && v.owners.length) {\n    lines.push(\"rendered by: \" + v.owners.map((o) => o.displayName).join(\" > \"));\n  }\n  const source = Array.isArray(v.source)\n    ? [v.source[1], v.source[2], v.source[3]]","sourceCodeStart":125,"sourceCodeEnd":161,"githubUrl":"https://github.com/vercel-labs/agent-browser/blob/548b159b30eef119ccf6846c8bc807d0eaa3f6f8/cli/src/native/react/scripts.rs#L125-L161","documentation":"Same renderer guard as the tree snapshot, but inside TREE_INSPECT ('react inspect <id>'): the hook is present yet rendererInterfaces has no usable renderer for the picked id. Usually means the page reloaded or React re-initialized between the snapshot that produced the id and the inspect call, or the page never booted React.","triggerScenarios":"Running 'react inspect <id>' on a page that reloaded since the snapshot; inspecting right after 'agent-browser open' before React boots; inspecting on a non-React page.","commonSituations":"Long gaps between snapshot and inspect in an agent workflow (page auto-refresh, redirects, logout timers); SPAs that remount on route changes.","solutions":["Take a fresh tree ('react tree') and inspect the newly returned fiber id","Add a wait for the app root or React boot before inspecting","Keep snapshot and inspect adjacent in your automation to shrink the race window"],"exampleFix":"# before\nagent-browser react inspect 42   # page reloaded since snapshot\n\n# after\nagent-browser react tree            # fresh ids\nagent-browser react inspect 17      # id from the new snapshot","handlingStrategy":"validation","validationCode":"agent-browser eval \"Object.keys(window.__REACT_DEVTOOLS_GLOBAL_HOOK__?.renderers ?? {}).length > 0\"","typeGuard":"function canInspect(win: Window): boolean {\n  const hook = (win as any).__REACT_DEVTOOLS_GLOBAL_HOOK__;\n  return hook != null && Object.keys(hook.renderers ?? {}).length > 0;\n}","tryCatchPattern":null,"preventionTips":["Treat fiber ids as valid only for the current document — re-snapshot after any navigation","Run tree and inspect back-to-back in the same automation step","Watch for reload indicators (url changes, snapshot diffs) before inspecting"],"tags":["react","timing","stale-state","devtools"],"backgroundTag":null,"analyzedSha":"548b159b30eef119ccf6846c8bc807d0eaa3f6f8","analyzedAt":"2026-08-16T10:12:14.925Z","schemaVersion":2},"datasetVersion":"2026-08-16T13:17:31.715Z"}