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
This suggests that either the type is wrong (perhaps I've got the wrong ErrorEvent somehow?) or that the documentation is wrong.
Given the documentation above it does have an error.reason, I'm led to believe this is a copy paste mistake from above.
Steps to reproduce the behavior:
Add the code from the link above into your project.
Confirm that Typescript complains about an error.
Expected behavior
Correct documentation on how to capture error messages, and a recommendation on how to ensure that the right stack trace is captured.
I think this is right?
self.addEventListener('error', (error) => {
let err = error.error;
if ( ! (err instanceof Error)) {
err = new Error(error.message);
}
Sentry.captureException(err);
});
Screenshots
Additional context
I'm raising this issue because we're finding we're getting unexpected errors. The errors don't have an obvious stack trace so they're very difficult to diagnose.
Please list the package(s) involved in the issue, and include the version you are using
checkout-ui-extensions
Describe the bug
In the documentation for Sentry: https://shopify.dev/docs/api/checkout-ui-extensions/unstable/error-handling#sentry, the following code snippet is defined:
But, as per typescript,
reason
doesn't exist onerror
:Neither does it say so on MDN: https://developer.mozilla.org/en-US/docs/Web/API/ErrorEvent
This suggests that either the type is wrong (perhaps I've got the wrong ErrorEvent somehow?) or that the documentation is wrong.
Given the documentation above it does have an
error.reason
, I'm led to believe this is a copy paste mistake from above.Steps to reproduce the behavior:
Expected behavior
Correct documentation on how to capture error messages, and a recommendation on how to ensure that the right stack trace is captured.
I think this is right?
Screenshots
Additional context
I'm raising this issue because we're finding we're getting unexpected errors. The errors don't have an obvious stack trace so they're very difficult to diagnose.
#2198 would be hugely beneficial too.
The text was updated successfully, but these errors were encountered: