Issue
- I've set beforeSend to drop events containing the hydration error message, but they are still coming in.
or:
- I've set ignoreErrors to drop events containing the hydration error message, but they are still coming in.
Applies To
- All Customers
- Error Monitoring
- Filtering
Symptoms
- Hydration errors events are still coming in.
Resolution
React throws minified errors, then we process them to make them readable in the Sentry UI. The message from the event in Sentry will not match the filters, since they are applied client-side. The minified error message will need to be provided for the filter to work.
Instead of matching the error message like this,
ignoreErrors: [
'There was an error while hydrating. Because the error happened outside of a Suspense boundary, the entire root will switch to client rendering.' 'Hydration failed because the initial UI does not match what was rendered on the server.', 'Text content does not match server-rendered HTML.', ],
you will need to match the minified message, like this:
ignoreErrors: [
'https://reactjs.org/docs/error-decoder.html?invariant=423', // There was an error while hydrating...
'https://reactjs.org/docs/error-decoder.html?invariant=425' // Text content does not match server-rendered HTML...
]