Issue
I set ignoreErrors or beforeSend to drop hydration errors using the readable message I see in Sentry, but those events still arrive.
Applies To
All SaaS Customers and Self-Hosted Users
React SDK and Next.js SDK
Error Monitoring
Filtering
Resolution
ignoreErrors and beforeSend run in the browser against the exception message React actually throws. In production that message is minified. The readable hydration text in the Sentry UI is applied after the event is ingested, so it does not match those client-side filters.
Match the minified message. Production React errors include Minified React error #N plus either https://react.dev/errors/N or https://reactjs.org/docs/error-decoder.html?invariant=N.
If you are filtering in the SDK:
Use ignoreErrors with the minified codes, not the UI title. For example:
Sentry.init({
ignoreErrors: [
/Minified React error #(418|419|421|422|423|425)/,
],
});
Those numbers are the common React hydration invariants. String entries in ignoreErrors are partial matches. A regex is clearer when you want only those codes.
You can also drop them in beforeSend by reading hint.originalException.message and returning null.
In development, React throws the full readable text, so filters that match Hydration failed can work locally and still miss production events.
If events still appear after SDK filters:
The React hydration inbound filter only drops that same fixed set of codes. Other hydration-related errors still get through. See Why aren't my inbound filters filtering out all hydration errors?.
If Session Replay is on, Sentry can still create Replay Issues from replay data even when the error event was dropped. See Why am I still seeing Hydration Error issues?.
For ignoreErrors and beforeSend behavior, see Filtering.
