← All notes

Capture a Vue descendant error or wrap a React error boundary

Answer: onErrorCaptured() registers a hook after a descendant error has been captured. React uses an Error Boundary to display some fallback UI instead of the part that crashed.

What Vue captures

Errors can be captured from component renders, event handlers, lifecycle hooks, the setup() function, watchers, custom directive hooks, and transition hooks. The hook is given the error, the component instance that triggered it, and an information string for the error source type. The callback can return a boolean or void.

React's fallback UI

A render error can cause React to remove its UI from the screen. An Error Boundary wraps a part of the tree and shows fallback UI, for example an error message. Error boundaries do not catch errors for event handlers, which Vue's hook can capture. Error boundaries do not catch errors for event handlers, which Vue can capture.

| onErrorCaptured() | hook | |---|---| | onErrorCaptured() | Vue hook for a descendant error | | setup() and watchers | Some of the Vue sources that can be captured | | fallback UI | What a React Error Boundary can display | | event handlers | Caught by Vue's hook; not caught by an Error Boundary |

See also

Claims

Sources

License: this note is CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Summary by iinventedlight (AI-assisted). Sources: Vue docs, onErrorCaptured(); React docs, Component. CC-BY-4.0; CC-BY-4.0. Text was condensed and changed from the originals.

License: CC-BY-4.0 · Summary by iinventedlight (AI-assisted). Sources: Vue docs, onErrorCaptured(); React docs, Component. CC-BY-4.0; CC-BY-4.0.

Cite this

Permanent ID: iil:note:vz0jbjnw

iinventedlight. 2026. "Capture a Vue descendant error or wrap a React error boundary." iinventedlight Library, iil:note:vz0jbjnw, version of 2026-11-19. https://iinventedlight.com/library/notes/vue-error-captured/. License: CC-BY-4.0.

@misc{iil_note_vz0jbjnw,
  author = {{iinventedlight}},
  title = {{Capture a Vue descendant error or wrap a React error boundary}},
  howpublished = {iinventedlight Library},
  year = {2026},
  date = {2026-11-19},
  url = {https://iinventedlight.com/library/notes/vue-error-captured/},
  note = {Permanent ID iil:note:vz0jbjnw. License: CC-BY-4.0.},
}

Markdown

Spotted a mistake? Use the MCP feedback tool or email hello@iinventedlight.com. Or Report a correction (no account needed).

Extra files beside this note

These files use this note's license, shown below. Paper extras retain their reproduction status; a link is not a reproduction.

All artifact files (JSON index)

For language models and agents: start at /llms.txt | /agents.md | /.well-known/agent-library.json. This page in Markdown: /library/notes/vue-error-captured.md.