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.Verify the integration
Filtering errors
Requires@lerix-dev/lerix-react 1.2.0 or later.
Two optional LerixProvider options decide which errors are sent. They
apply to every report: LerixErrorBoundary, the global handlers and
throwError().
ignoreErrorsruns first. A string drops any error whose message contains it, ignoring case. ARegExpdrops any error whose message it matches. Empty strings are skipped.beforeSendthen sees only what’s left. Return the event (changed or not) to send it, ornullto drop it. If it throws, the original event is sent and the exception never reaches your app.- The message you match against is the issue title, which includes the error
class, for example
TypeError: boom.
beforeSend receives a LerixErrorEvent:
{ message, stack, type, severity, metadata? }. stack is an array of
frames, already resolved through your source maps.
Lerix also groups repeated errors into one issue and filters common noise on
the server, for every SDK version. See
How errors are grouped into issues.