{"record":{"id":"a38f2718d7a7fd99","repo":"facebook/react","slug":"unsupported-node-type-node-type","errorCode":null,"errorMessage":"Unsupported node type: ${node.type}","messagePattern":"Unsupported node type: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/eslint-plugin-react-hooks/src/rules/ExhaustiveDeps.ts","lineNumber":1966,"sourceCode":"    markNode(node, optionalChains, result);\n    return result;\n  } else if (\n    node.type === 'ChainExpression' &&\n    (!('computed' in node) || !node.computed)\n  ) {\n    const expression = node.expression;\n\n    if (expression.type === 'CallExpression') {\n      throw new Error(`Unsupported node type: ${expression.type}`);\n    }\n\n    const object = analyzePropertyChain(expression.object, optionalChains);\n    const property = analyzePropertyChain(expression.property, null);\n    const result = `${object}.${property}`;\n    markNode(expression, optionalChains, result);\n    return result;\n  } else {\n    throw new Error(`Unsupported node type: ${node.type}`);\n  }\n}\n\nfunction getNodeWithoutReactNamespace(\n  node: Expression | Super,\n): Expression | Identifier | Super {\n  if (\n    node.type === 'MemberExpression' &&\n    node.object.type === 'Identifier' &&\n    node.object.name === 'React' &&\n    node.property.type === 'Identifier' &&\n    !node.computed\n  ) {\n    return node.property;\n  }\n  return node;\n}\n","sourceCodeStart":1948,"sourceCodeEnd":1984,"githubUrl":"https://github.com/facebook/react/blob/eafeac097ba51e1eab809c07102126bd5f8e5425/packages/eslint-plugin-react-hooks/src/rules/ExhaustiveDeps.ts#L1948-L1984","documentation":"This is the catch-all of analyzePropertyChain in exhaustive-deps. The function only knows how to turn Identifiers and non-computed MemberExpression/OptionalMemberExpression chains into dotted paths; any other node type - computed member access, calls, binary expressions, template literals - cannot become a property chain and hits the final throw with the node's type name. So a dependency entry whose root shape is not a plain dotted reference crashes the rule.","triggerScenarios":"A dependency array entry that is a computed access (items[i], data[key]), a direct invocation (fn() or obj.method()), or an arbitrary expression (a + b, `tpl-${x}`) where analyzePropertyChain is asked to analyze the root node. Computed MemberExpression (node.computed === true) and bare CallExpression both fall through every accepting branch into the else-throw.","commonSituations":"Listing a computed value like items[0] as a dependency instead of items; listing a function call result instead of the function; migrating codebases where deps arrays were written casually; older plugin versions paired with newer parsers.","solutions":["Replace the offending entry with a reference the rule understands: depend on the array/object (items) or the function (fn), not an indexed or called result","Hoist the computed value into a stable variable (const first = items[0]) before the hook and depend on the variable","Update eslint-plugin-react-hooks in case your version predates support for the syntax shape you hit","If the exotic dependency is intentional, inline eslint-disable-next-line react-hooks/exhaustive-deps with a justification comment"],"exampleFix":"// before\nuseMemo(() => items[0]?.trim(), [items[0]]);\n\n// after\nconst first = items[0];\nuseMemo(() => first?.trim(), [first]);","handlingStrategy":"validation","validationCode":"// Flag non-reference deps entries (computed access, calls, expressions)\n// before lint: hook callbacks and their arrays can be checked with a quick parse\n// (or simply review for these shapes): items[i], data[key], fn(), a + b\nconst suspiciousDep = /\\[\\s*(\\w+\\s*\\[|\\w+\\s*\\(|[^\\]a-zA-Z0-9._$\\s])/;\nif (suspiciousDep.test(depsArraySource)) {\n  console.warn('Deps array contains a computed/call/expression entry - hoist it to a variable');\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Deps arrays should contain references (identifiers and dotted chains), not expressions","Hoist computed values (items[0], data[key]) into named variables before the hook","Depend on the function itself, never on its call","Code-review dependency arrays in hook-heavy modules"],"tags":["eslint","react-hooks","computed-property","static-analysis","dependency-array"],"backgroundTag":"unsupported-ast-node","analyzedSha":"eafeac097ba51e1eab809c07102126bd5f8e5425","analyzedAt":"2026-08-21T22:01:08.818Z","schemaVersion":2},"datasetVersion":"2026-08-21T23:17:16.201Z"}