Title: Improve Sentry react router steps · Issue #17228 · getsentry/sentry-javascript · GitHub
Open Graph Title: Improve Sentry react router steps · Issue #17228 · getsentry/sentry-javascript
X Title: Improve Sentry react router steps · Issue #17228 · getsentry/sentry-javascript
Description: Problem Statement React router steps should mention that when running on serverless (Vercel in my case), server might not be able to flush the logs before execution is stopped. Way to mitigate that is to use waitUntil from Vercel (or som...
Open Graph Description: Problem Statement React router steps should mention that when running on serverless (Vercel in my case), server might not be able to flush the logs before execution is stopped. Way to mitigate that...
X Description: Problem Statement React router steps should mention that when running on serverless (Vercel in my case), server might not be able to flush the logs before execution is stopped. Way to mitigate that...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/17228
X: @github
Domain: github.com
IPv4 address: 140.82.114.3
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Improve Sentry react router steps","articleBody":"### Problem Statement\n\n\n[React router steps](https://docs.sentry.io/platforms/javascript/guides/react-router/) should mention that when running on serverless (Vercel in my case), server might not be able to flush the logs before execution is stopped. Way to mitigate that is to use waitUntil from Vercel (or something similar for other serverless platforms) similarly how it is already used in other Sentry libs like [here](https://github.com/getsentry/sentry-javascript/blob/bc7bc13e23be2cc12718945171da304969f446b1/packages/nextjs/src/edge/wrapApiHandlerWithSentry.ts#L91) for next.js where [vercelWaitUntil](https://github.com/getsentry/sentry-javascript/blob/develop/packages/core/src/utils/vercelWaitUntil.ts#L16) is used.\n\nI spent a lot of time to figure this out so having it mentioned in docs would save people a lot of time. I ended up solving it like this:\n```\nimport { vercelWaitUntil } from '@sentry/core';\n\n...\n\nexport const handleError: HandleErrorFunction = async (error, { request }) => {\n // React Router may abort some interrupted requests, don't log those\n if (!request.signal.aborted) {\n Sentry.captureException(error);\n\n console.error(error);\n\n vercelWaitUntil(flushSafelyWithTimeout());\n }\n};\n```\n\nalso the docs should mention that if you are instrumenting server with import in server entry file (when you are using serverless where you can't use NODE_OPTIONS), vite will tree shake that file so you need to mark it as side effect in package.json\n\n### Solution Brainstorm\n\nSee problem statement.","author":{"url":"https://github.com/jbojcic1","@type":"Person","name":"jbojcic1"},"datePublished":"2025-07-30T12:06:36Z","url":"https://github.com/getsentry/sentry-javascript/issues/17228"}
| 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:69ca3596-cfa3-dcd6-e3b0-54bfca3a03e4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D4C8:277E4A:E6C13:13F418:6B05D0E2 |
| html-safe-nonce | d9c6bcf05ee3f6565f03dee471096083154f6271a8f12e244c9bc83434d9e7c1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJENEM4OjI3N0U0QTpFNkMxMzoxM0Y0MTg6NkIwNUQwRTIiLCJ2aXNpdG9yX2lkIjoiOTc4NzI5MzQ5NTQ3NDEzNzMwIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 24fc8b5912303616f6cbbd46e429175505944ad8ee75a7fd976fa2dd3c5f36bd |
| hovercard-subject-tag | issue:3276774684 |
| 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/17228/issue_layout |
| twitter:image | https://opengraph.githubassets.com/e1589e5b2c116052f63cd9bcedb580cbacbfc3cac35b8a9ebc8a4f0e0bb8ff40/getsentry/sentry-javascript/issues/17228 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/e1589e5b2c116052f63cd9bcedb580cbacbfc3cac35b8a9ebc8a4f0e0bb8ff40/getsentry/sentry-javascript/issues/17228 |
| og:image:alt | Problem Statement React router steps should mention that when running on serverless (Vercel in my case), server might not be able to flush the logs before execution is stopped. Way to mitigate that... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | jbojcic1 |
| hostname | github.com |
| expected-hostname | github.com |
| None | 08d6d51500e13cdaf71a9aad37c03e883f1143f9325056e77a14fa0d06d5bf64 |
| 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 | 839b69d5acfb3181bc844f20b9848f74b957add3 |
| 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