{"record":{"id":"4975c9354f5d7f32","repo":"facebook/react","slug":"unsupported-instance-kind","errorCode":null,"errorMessage":"Unsupported instance kind","messagePattern":"Unsupported instance kind","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/react-devtools-shared/src/backend/fiber/renderer.js","lineNumber":6039,"sourceCode":"  }\n\n  function inspectElementRaw(id: number): InspectedElement | null {\n    const devtoolsInstance = idToDevToolsInstanceMap.get(id);\n    if (devtoolsInstance === undefined) {\n      console.warn(`Could not find DevToolsInstance with id \"${id}\"`);\n      return null;\n    }\n    if (devtoolsInstance.kind === VIRTUAL_INSTANCE) {\n      return inspectVirtualInstanceRaw(devtoolsInstance);\n    }\n    if (devtoolsInstance.kind === FIBER_INSTANCE) {\n      const isRoot = devtoolsInstance.parent === null;\n      return isRoot\n        ? inspectRootsRaw(devtoolsInstance.id)\n        : inspectFiberInstanceRaw(devtoolsInstance);\n    }\n    devtoolsInstance as FilteredFiberInstance; // assert exhaustive\n    throw new Error('Unsupported instance kind');\n  }\n\n  function inspectFiberInstanceRaw(\n    fiberInstance: FiberInstance,\n  ): InspectedElement | null {\n    const fiber = fiberInstance.data;\n    if (fiber == null) {\n      return null;\n    }\n\n    const {\n      stateNode,\n      key,\n      memoizedProps,\n      memoizedState,\n      dependencies,\n      tag,\n      type,","sourceCodeStart":6021,"sourceCodeEnd":6057,"githubUrl":"https://github.com/facebook/react/blob/eafeac097ba51e1eab809c07102126bd5f8e5425/packages/react-devtools-shared/src/backend/fiber/renderer.js#L6021-L6057","documentation":"react-devtools-shared's Fiber backend resolves an element ID to a DevToolsInstance and inspectElementRaw() only knows how to inspect two kinds: VIRTUAL_INSTANCE (Flight/server-graph virtual nodes) and FIBER_INSTANCE (real Fibers). Anything else - today FILTERED_FIBER_INSTANCE (elements hidden by component filters) or a kind introduced by a newer backend - falls through the exhaustive check and throws. It is an internal invariant meaning the backend was asked to inspect an instance kind it deliberately does not support.","triggerScenarios":"A bridge 'inspectElement' request (selecting an element in the Components tree, hovering a highlight, re-inspecting a persisted selection) where idToDevToolsInstanceMap.get(id).kind is FILTERED_FIBER_INSTANCE - e.g. the selection predates applying hide-filters or the Activity filter - or a version-skewed frontend/backend where the kind enum has new members.","commonSituations":"Enabling 'hide components matching' filters while an element stays selected; restoring a persisted selection across a reload with different filter settings; mixing the DevTools browser extension with an embedded react-devtools-shared build of a different version.","solutions":["Clear the current selection and re-select a visible (unfiltered) element, or reload the page with DevTools open so stale selections are dropped.","Make sure the DevTools extension and any embedded react-devtools-shared package are the same version (the DevToolsInstance kind set must match on both sides).","If you embed devtools-shared, mirror the kind checks at renderer.js:6029-6037 - only call inspectElementRaw for FIBER_INSTANCE/VIRTUAL_INSTANCE ids.","If it reproduces with matched versions and no filters, file a React DevTools issue with the filter config and steps."],"exampleFix":"// before (custom frontend, sends inspect for any stored id)\nbridge.send('inspectElement', {id: selectedID, rendererID});\n\n// after (only inspect ids the backend still reports as visible elements)\nconst element = store.getElementByID(selectedID);\nif (element != null && !isFilteredOut(element)) {\n  bridge.send('inspectElement', {id: selectedID, rendererID});\n}","handlingStrategy":"type-guard","validationCode":"// before sending 'inspectElement' over the bridge, confirm the id is still a visible element\nconst element = store.getElementByID(id);\nif (element == null || store.isFilteredOut(element)) {\n  console.warn('Skipping inspect for filtered/gone element', id);\n} else {\n  bridge.send('inspectElement', {id, rendererID});\n}","typeGuard":"function isInspectableInstance(instance) {\n  return (\n    instance != null &&\n    (instance.kind === 'FIBER_INSTANCE' || instance.kind === 'VIRTUAL_INSTANCE')\n  );\n}","tryCatchPattern":null,"preventionTips":["Re-select elements after changing component filters instead of keeping the old selection active.","Keep the DevTools extension and any embedded react-devtools-shared on the same version so the instance-kind enum matches.","When embedding devtools-shared, mirror the FIBER_INSTANCE/VIRTUAL_INSTANCE checks from renderer.js:6029-6037 before calling inspection APIs."],"tags":["react-devtools","devtools-shared","component-filters","inspect-element","exhaustive-switch"],"backgroundTag":"devtools-internal-invariant","analyzedSha":"eafeac097ba51e1eab809c07102126bd5f8e5425","analyzedAt":"2026-08-21T22:01:08.818Z","schemaVersion":2},"datasetVersion":"2026-08-22T04:17:13.399Z"}