getsentry / sentry-javascript

Official Sentry SDKs for JavaScript
https://sentry.io
MIT License
7.76k stars 1.52k forks source link

ErrorBoundary not workling on remix integration #12255

Open sbolanosQB opened 1 month ago

sbolanosQB commented 1 month ago

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.5.0

Framework Version

18.2.0

Link to Sentry event

No response

SDK Setup

No response

Steps to Reproduce

export const ErrorBoundary = () => {
  const error = useRouteError();

  captureRemixErrorBoundaryError(error);

  return <QbNavErrorPage />;
};

export default withSentry(App, {
  wrapWithErrorBoundary: true,
  errorBoundaryOptions: { fallback: ErrorBoundary },
});

Expected Result

an automatic rerouting when an error is thrown

Actual Result

Nothing

AbhiPrasad commented 1 month ago

I think using the Remix error boundary as a fallback is not how this option is intended to be used. I'd set wrapWithErrorBoundary: false, and then wrap your react components with ErrorBoundary accordingly.

sbolanosQB commented 1 month ago

I think using the Remix error boundary as a fallback is not how this option is intended to be used. I'd set wrapWithErrorBoundary: false, and then wrap your react components with ErrorBoundary accordingly.

Hi, thanks for the quick answer. then wrap your react components with ErrorBoundary accordingly this is unclear to me, can you post a small example?

AbhiPrasad commented 1 month ago

I think you can just leave the export of the error boundary. Here's an example from our e2e tests: https://github.com/getsentry/sentry-javascript/blob/develop/dev-packages/e2e-tests/test-applications/create-remix-app-v2/app/root.tsx

getsantry[bot] commented 3 days ago

This issue has gone three weeks without activity. In another week, I will close it.

But! If you comment or otherwise update it, I will reset the clock, and if you remove the label Waiting for: Community, I will leave it alone ... forever!


"A weed is but an unloved flower." ― Ella Wheeler Wilcox 🥀