Introduction
Lerix captures errors from your React app so you can debug issues faster. After you complete the React installation, useuseLerix().throwError() to send custom errors to your dashboard —
uncaught errors are captured automatically, with no extra code required.
Make sure your app is wrapped in
LerixProvider before reporting errors.Report an error
Parameters
BugType values
BugSeverity values
Automatic error capture
LerixProvider installs error capture two ways, so nothing needs wrapping in a try/catch for baseline coverage:
LerixErrorBoundarycatches errors thrown during rendering — React’s error boundary contract only covers the render phase, not event handlers or async code.- Global
window.onerrorandunhandledrejectionlisteners catch everything else — event handlers, timers, promise rejections.
fallback can be a plain element, or a function receiving the caught error: fallback={(error) => <p>{String(error)}</p>}.
To disable the global handlers (e.g. if your app already has its own error reporting and you only want manual throwError calls):
LerixErrorBoundary still catches render errors regardless of this flag — it’s a separate, explicit component you control by where you place it.
Automatic stack capture
When you callthrowError() without a stack argument, one is captured
automatically from the call site — you only need to pass one explicitly
when reporting a caught Error’s own stack instead (e.g.
error.stack?.split('\n')).
Either way, every stack frame is resolved from its compiled/bundled
position (e.g. a bundler’s output file and line) back to the original
source file and line, using the build’s own source map — the same
mechanism browser DevTools use to show you readable stack traces instead
of minified bundle positions. This happens automatically; there’s nothing
to configure.
Resolution requires a source map to be reachable at the frame’s URL —
always true in development, and true in production only if your build
serves its
.map files publicly. If your production build keeps source
maps private (a common choice), frames fall back to their compiled
position rather than failing to report — resolution is best-effort and
never blocks or delays the report itself.