Title: Remix: Sentry conflict with Remix's Error Boundaries · Issue #5762 · getsentry/sentry-javascript · GitHub
Open Graph Title: Remix: Sentry conflict with Remix's Error Boundaries · Issue #5762 · getsentry/sentry-javascript
X Title: Remix: Sentry conflict with Remix's Error Boundaries · Issue #5762 · getsentry/sentry-javascript
Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using the latest SDK release https://github.com/...
Open Graph Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th...
X Description: Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/5762
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Remix: Sentry conflict with Remix's Error Boundaries","articleBody":"### Is there an existing issue for this?\n\n- [X] I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues\n- [X] I have reviewed the documentation https://docs.sentry.io/\n- [X] I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases\n\n### How do you use Sentry?\n\nSentry Saas (sentry.io)\n\n### Which package are you using?\n\n@sentry/remix\n\n### SDK Version\n\n7.13.0\n\n### Framework Version\n\nReact 18.2.0 / Remix 1.7.1\n\n### Link to Sentry event\n\n_No response_\n\n### Steps to Reproduce\n\nSet up a new Remix app and add Sentry. Add an ErrorBoundary export to the root file:\r\n\r\n```tsx\r\n// app/root.tsx\r\n\r\n// ...\r\n\r\nexport const ErrorBoundary: ErrorBoundaryComponent = () => {\r\n return \u003cdiv>REMIX BOUNDARY\u003c/div>;\r\n}\r\n\r\nfunction App() {\r\n // ...\r\n}\r\n\r\nexport default withSentry(App, {\r\n wrapWithErrorBoundary: true,\r\n errorBoundaryOptions: {\r\n fallback: \u003cdiv>SENTRY BOUNDARY\u003c/div>;\r\n }\r\n})\r\n```\r\n\n\n### Expected Result\n\nI should be able to use Remix's own ErrorBoundary functionality both at the root level and in child routes and still have Sentry know when/when not to report errors.\r\n\r\nAlternatively, if there are limitations in Remix that won't let this work as expected, the documentation should be clearer about server/client error handling and error boundaries.\n\n### Actual Result\n\nThe custom \"REMIX BOUNDARY\" ErrorBoundary above only gets displayed if the error was server side. All client-side errors use the \"SENTRY BOUNDARY\" error set in `withSentry` (unless you have a route-level ErrorBoundary, then client-side errors never make it to Sentry. My guess is that the `withSentry` fallback/wrapper completely ignores all server-side errors to avoid double-reporting.)There are a bunch of combinations of server/client errors and server/client rendering (I'm sure I'm missing some):\r\n\r\n- SSR/CSR loader/action error: Sentry reports this server-side and does not report it client-side. The Remix boundary is displayed. If I remove the Remix boundary export, a raw error trace is rendered. Sentry's fallback is never displayed.\r\n- CSR rendering error: Sentry reports the error and the Sentry fallback is displayed. The Remix boundary is *not* shown.\r\n- SSR rendering error: Sentry reports the error server-side. Same result client-side as the loader/action errors in the first bullet above.\r\n\r\nIf I add a custom Remix ErrorBoundary export to a child route, the behavior is the same with one exception:\r\n\r\n- CSR rendering error: Sentry does *not* report any error and the Remix boundary is shown. This seems to be the most common spot for errors to go unreported.\r\n\r\nIt seems the only viable solution until this is addressed is:\r\n\r\n- Add a root-level Remix error boundary AND a custom fallback to Sentry that are essentially duplicates of each other so you get consistent error screens.\r\n- Don't use route-level error boundaries (which goes against the whole point of Remix's nested route handling), or if you do, manually call `Sentry.captureException(...)` in them, though that could possibly report duplicate issues from both the server and client side.","author":{"url":"https://github.com/dmarkow","@type":"Person","name":"dmarkow"},"datePublished":"2022-09-16T20:36:17Z","url":"https://github.com/getsentry/sentry-javascript/issues/5762"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322 |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:a3c302fd-9b47-cdf9-1bd5-62f52965484b |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 917A:258558:8306C5:ACB38C:6B04CD5C |
| html-safe-nonce | 83d13a293cce03ee5a28501c9d60cfdfe25598df0f50050d5e2acb0296a447d1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5MTdBOjI1ODU1ODo4MzA2QzU6QUNCMzhDOjZCMDRDRDVDIiwidmlzaXRvcl9pZCI6IjI0Mjg4MjE0OTY3OTAzMDYxNDAiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | 76e2c0deef3bfe0e90d0056456082616cd3d72bc49d198b7f5fa765ac46f8ffe |
| hovercard-subject-tag | issue:1376446094 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/5762/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4bec2834e04dcaf92237247cb720eeafd2afc7d072b8e946cbc11a452ea55d9d/getsentry/sentry-javascript/issues/5762 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4bec2834e04dcaf92237247cb720eeafd2afc7d072b8e946cbc11a452ea55d9d/getsentry/sentry-javascript/issues/5762 |
| og:image:alt | Is there an existing issue for this? I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues I have reviewed the documentation https://docs.sentry.io/ I am using th... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | dmarkow |
| hostname | github.com |
| expected-hostname | github.com |
| None | 27ed421e5c2dac040a37529b5b9191edcc4a3de70521471e81fb4b4d9dc2aa7d |
| turbo-cache-control | no-preview |
| go-import | github.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git |
| octolytics-dimension-user_id | 1396951 |
| octolytics-dimension-user_login | getsentry |
| octolytics-dimension-repository_id | 3328572 |
| octolytics-dimension-repository_nwo | getsentry/sentry-javascript |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 3328572 |
| octolytics-dimension-repository_network_root_nwo | getsentry/sentry-javascript |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 63dc19014c621c67306d7899c04c78dcd0d95803 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
| Server | github.com |
| Content-Type | text/html; charset=utf-8 |
| Cache-Control | max-age=0, private, must-revalidate |
Viewport: width=device-width