Agent Skills fixes its React error boundary, which crashed even with healthy children

1 day ago

Agent Skills' shipping-and-launch skill taught a React error boundary that crashed on every render and never showed its fallback. Pull request 637, merged October 10, 2026, initializes its state and adds getDerivedStateFromError. It is on main, after the 0.6.12 release. https://github.com/addyosmani/agent-skills/pull/637 https://github.com/addyosmani/agent-skills/blob/main/skills/shipping-and-launch/SKILL.md https://github.com/addyosmani/agent-skills

Ask

Ask about this presentation

Answers are generated from this presentation.

Chapters

  1. 0:00Agent Skills fixes its React error boundary, which crashed even with healthy children
  2. 0:18The boundary read its state before setting any
  3. 0:32It could report an error but never switch to the fallback
  4. 0:48Six added lines set a starting state and add the missing lifecycle
  5. 1:04With React 19.2, all three checks pass
  6. 1:19Strict TypeScript still flags the sample's props
  7. 1:36Check any error boundary your agent copied from the shipping skill
Show transcript

Agent Skills fixes its React error boundary, which crashed even with healthy children

github.com/addyosmani/agent-skillsmerged Oct 10, 2026
throws on every renderfallback renders
shipping-and-launch skill · PR #637

Addy Osmani's Agent Skills teaches your coding agent a React error boundary, inside its shipping and launch skill. That sample threw on every render, even when every component inside it was healthy. A fix merged on October 10 makes the boundary render its fallback screen.

The boundary read its state before setting any

shipping-and-launch · Error Reportingbefore
class ErrorBoundary extends React.Component {
  componentDidCatch(error, info) { reportError(…) }

  render() {
    if (this.state.hasError) {
      return <ErrorFallback onRetry={…} />;
    }
    return this.props.children;
  }
}
TypeError: Cannot read properties of null (reading ‘hasError’)
PR #637 · skills/shipping-and-launch/SKILL.md

The render method checks this.state.hasError, but the class never gives state a starting value. So state is null, and the boundary crashes with a type error on its first render, before any child has done anything wrong.

It could report an error but never switch to the fallback

shipping-and-launch · Error Reportingbefore
✓componentDidCatchsends the error to tracking
✗getDerivedStateFromErrormissing, so hasError never turns true
PR #637 · skills/shipping-and-launch/SKILL.md

The sample had componentDidCatch, which sends the error to a tracking service. It had no getDerivedStateFromError, the lifecycle method that flips hasError to true. Without it, a crashing child gets reported, and the fallback screen stays hidden.

Six added lines set a starting state and add the missing lifecycle

shipping-and-launch · Error Reportingafter
class ErrorBoundary extends React.Component {
  state = { hasError: false };

  static getDerivedStateFromError() {
    return { hasError: true };
  }

  componentDidCatch(error, info) { reportError(…) }
  render() { … unchanged … }
}
PR #637 · commit a31135a2

The fix gives state a starting value of hasError false, and adds a static getDerivedStateFromError that returns hasError true when a child throws. The error report, with its component stack, user and page, stays as it was, and so does the retry button.

With React 19.2, all three checks pass

React 19.2 · ReactDOM 19.2 · jsdomafter
✓Healthy childrenders · zero error reports
✓Failing childfallback shows · error, stack, user, page reported
✓Retry after recoverychild renders again · no new report
PR #637 · reproduction

With React 19.2, a healthy child now renders with zero error reports. A failing child shows the fallback and reports the original error. And pressing retry once the child recovers brings it back without a second report.

Strict TypeScript still flags the sample's props

shipping-and-launch · Error Reportingstill open

Strict TypeScript still flags the sample’s props

✗this.props.childrenuntyped React.Component · follow-up
✗jsdom onlya DOM runtime check · no browser engine
PR #637 · review by addyosmani

The class still extends an untyped React Component, so strict TypeScript flags this.props.children. Typing the props is left for a follow-up. The three checks ran in jsdom, a simulated browser DOM, so a real browser engine hasn't run them.

Check any error boundary your agent copied from the shipping skill

github.com/addyosmani/agent-skillsmerged Oct 10, 2026
pluginagent-skills · Claude Code and Codex
wheremain, after the Oct 3 release
sourcegithub.com/addyosmani/agent-skills/pull/637
PR #637 · .claude-plugin · .codex-plugin

The fix is on the main branch of the agent-skills plugin for Claude Code and Codex, newer than the October 3 release. If your agent built an error boundary from the shipping and launch skill, compare it with pull request 637.