You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed recently some users were reporting errors that weren't showing up in Sentry. I dug into our server handling code and it was from a recent update we made with the Sentry config.
The problem is, wrapHandleErrorWithSentry is a function that returns a function, meant to wrap your own custom error handler. If you call it as described, the function isn't getting called. So when Remix triggers an error, it calls the wrapper only. All that does it return a function, but doesn't actually call that function. So the errors never get reported.
It works as expected. I also tried running npx @sentry/wizard@latest -i remix, which doesn't actually use the wrapHandleErrorWithSentry approach that the documentation recommends. Instead, it just inserts its own handleError function that doesn't exactly match what wrapHandleErrorWithSentry does internally.
Expected Result
It's ultimately my mistake for not testing server-side reporting after making a configuration change, but I would expect a working error handler when I following the documentation exactly. Documentation should mention that wrapHandleErrorWithSentry is a function that must be called to return a working error handler, e.g.:
This is indeed correct, thanks for reporting this! 🙌🏻
Our migration docs in the JS repository actually show a correct implementation. I will change it accordingly in the docs and in the wizard.
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/remix
SDK Version
8.15.0
Framework Version
Remix 2.10.2
Link to Sentry event
No response
SDK Setup/Reproduction Example
No response
Steps to Reproduce
I noticed recently some users were reporting errors that weren't showing up in Sentry. I dug into our server handling code and it was from a recent update we made with the Sentry config.
https://docs.sentry.io/platforms/javascript/guides/remix/manual-setup/#server-side-errors
I updated our Remix integration using the documentation for server side errors:
The problem is,
wrapHandleErrorWithSentry
is a function that returns a function, meant to wrap your own custom error handler. If you call it as described, the function isn't getting called. So when Remix triggers an error, it calls the wrapper only. All that does it return a function, but doesn't actually call that function. So the errors never get reported.If I change it to:
It works as expected. I also tried running
npx @sentry/wizard@latest -i remix
, which doesn't actually use thewrapHandleErrorWithSentry
approach that the documentation recommends. Instead, it just inserts its ownhandleError
function that doesn't exactly match whatwrapHandleErrorWithSentry
does internally.Expected Result
It's ultimately my mistake for not testing server-side reporting after making a configuration change, but I would expect a working error handler when I following the documentation exactly. Documentation should mention that
wrapHandleErrorWithSentry
is a function that must be called to return a working error handler, e.g.:Actual Result
Server side errors are not reported.
The text was updated successfully, but these errors were encountered: