Skip to content

Track and expose component error/warning countsΒ #19

@piotrski

Description

@piotrski

Problem

The React DevTools protocol sends UPDATE_ERRORS_OR_WARNINGS operations (op type 5) with per-component error and warning counts. We parse and skip them at component-tree.ts:242:

case TREE_OPERATION_UPDATE_ERRORS_OR_WARNINGS: {
  // id, numErrors, numWarnings
  i += 4;
  break;
}

This is high-signal data for AI agents β€” "find the component with errors" is a very common debugging starting point.

Proposed solution

  1. Store error/warning counts on ComponentNode (add errors: number and warnings: number fields)
  2. Update the TREE_OPERATION_UPDATE_ERRORS_OR_WARNINGS handler to write the counts
  3. Add a CLI command: errors β€” list components with non-zero error or warning counts
  4. Include error/warning counts in get component output when non-zero
  5. Optionally annotate the tree output (e.g., @c5 [fn] "Form" ⚠2 βœ—1)

IPC additions

  • New command: { type: 'errors' } β€” returns components with errors/warnings
  • Update get-component response to include counts when non-zero

Files to change

  • src/types.ts β€” add errors/warnings to ComponentNode, add IPC command
  • src/component-tree.ts β€” store counts in the operation handler
  • src/daemon.ts β€” handle new IPC command
  • src/cli.ts β€” add errors command
  • src/formatters.ts β€” format error/warning output, annotate component/tree display
  • src/__tests__/component-tree.test.ts β€” test operation parsing

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions