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
- Store error/warning counts on
ComponentNode (add errors: number and warnings: number fields)
- Update the
TREE_OPERATION_UPDATE_ERRORS_OR_WARNINGS handler to write the counts
- Add a CLI command:
errors — list components with non-zero error or warning counts
- Include error/warning counts in
get component output when non-zero
- 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
Problem
The React DevTools protocol sends
UPDATE_ERRORS_OR_WARNINGSoperations (op type 5) with per-component error and warning counts. We parse and skip them atcomponent-tree.ts:242:This is high-signal data for AI agents — "find the component with errors" is a very common debugging starting point.
Proposed solution
ComponentNode(adderrors: numberandwarnings: numberfields)TREE_OPERATION_UPDATE_ERRORS_OR_WARNINGShandler to write the countserrors— list components with non-zero error or warning countsget componentoutput when non-zero@c5 [fn] "Form" ⚠2 ✗1)IPC additions
{ type: 'errors' }— returns components with errors/warningsget-componentresponse to include counts when non-zeroFiles to change
src/types.ts— adderrors/warningstoComponentNode, add IPC commandsrc/component-tree.ts— store counts in the operation handlersrc/daemon.ts— handle new IPC commandsrc/cli.ts— adderrorscommandsrc/formatters.ts— format error/warning output, annotate component/tree displaysrc/__tests__/component-tree.test.ts— test operation parsing