René's URL Explorer Experiment


Title: [React-Router Framework]: Add Cloudflare support · Issue #17334 · getsentry/sentry-javascript · GitHub

Open Graph Title: [React-Router Framework]: Add Cloudflare support · Issue #17334 · getsentry/sentry-javascript

X Title: [React-Router Framework]: Add Cloudflare support · Issue #17334 · getsentry/sentry-javascript

Description: Description Deploying @sentry/react-router to Cloudflare Workers is currently not supported out of the box. However, this issue provides a workaround for making it work. Support renderToReadableStream The react-router SDK is currently us...

Open Graph Description: Description Deploying @sentry/react-router to Cloudflare Workers is currently not supported out of the box. However, this issue provides a workaround for making it work. Support renderToReadableStr...

X Description: Description Deploying @sentry/react-router to Cloudflare Workers is currently not supported out of the box. However, this issue provides a workaround for making it work. Support renderToReadableStr...

Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/17334

X: @github

direct link

Domain: github.com

IPv4 address: 140.82.113.3


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"[React-Router Framework]: Add Cloudflare support","articleBody":"### Description\n\nDeploying `@sentry/react-router` to Cloudflare Workers is currently not supported out of the box. However, this issue provides a workaround for making it work.\n\n### Support `renderToReadableStream`\n\nThe react-router SDK is currently using [`renderToPipeableStream`](https://github.com/getsentry/sentry-javascript/blob/ac57eb17ad3db93f7d24335e39d85211cb1e068f/packages/react-router/src/server/createSentryHandleRequest.tsx#L96) which is a Node-only API. For react-router to be able to inject the HTML meta tags, this code needs to be adapted to use `renderToReadableStream`.\n\n### Current Workaround\n\nWrap the handler with `withSentry` from `@sentry/cloudflare`:\n\n```ts\n// in entry.worker.ts\nimport type { unstable_InitialContext } from \"react-router\";\nimport { createRequestHandler, unstable_createContext } from \"react-router\";\nimport * as build from \"virtual:react-router/server-build\";\nimport * as Sentry from \"@sentry/cloudflare\";\n\nconst CloudflareContext = unstable_createContext\u003c{\n  env: Cloudflare.Env;\n  ctx: ExecutionContext;\n  cf?: RequestInitCfProperties;\n}>();\n\nexport default Sentry.withSentry(\n  () => ({ /* Sentry config options */ }),\n  {\n    async fetch(request: Request, env: Cloudflare.Env, ctx: ExecutionContext) {\n      const context: unstable_InitialContext = new Map();\n      context.set(CloudflareContext, { env, ctx, cf: request.cf });\n      return await handler(request, context);\n    },\n  } satisfies ExportedHandler\u003cCloudflare.Env>,\n);\n```\n\nNow, create a function to include the HTML meta tags (like [here](https://github.com/getsentry/sentry-javascript/blob/ac57eb17ad3db93f7d24335e39d85211cb1e068f/packages/react-router/src/server/wrapSentryHandleRequest.ts#L80)) and inject them into the returned body:\n```ts\n// in app/entry.server.tsx\nimport { renderToReadableStream } from \"react-dom/server\";\nimport { getTraceMetaTags, getTraceData, getClient } from \"@sentry/core\";\n\nfunction getWebMetaTagTransformer(): TransformStream\u003cUint8Array, Uint8Array> {\n  const headClosingTag = \"\u003c/head>\";\n\n  const decoder = new TextDecoder();\n  const encoder = new TextEncoder();\n\n  return new TransformStream({\n    transform(chunk, controller) {\n      const html = decoder.decode(chunk);\n\n      if (html.includes(headClosingTag)) {\n        const modifiedHtml = html.replace(\n          headClosingTag,\n          `${getTraceMetaTags()}${headClosingTag}`,\n        );\n        controller.enqueue(encoder.encode(modifiedHtml));\n        return;\n      }\n      controller.enqueue(chunk);\n    },\n  });\n}\n\nexport default async function handleRequest(/* .... */){\n  // ...\n\n  const body = await renderToReadableStream(/* ... */)\n\n  const sentryTransformer = getWebMetaTagTransformer();\n  const transformedBody = body.pipeThrough(sentryTransformer);\n  \n  return new Response(transformedBody, {\n      headers: responseHeaders,\n      status: responseStatusCode,\n   });\n}\n```\n\n\n","author":{"url":"https://github.com/s1gr1d","@type":"Person","name":"s1gr1d"},"datePublished":"2025-08-06T09:44:10Z","url":"https://github.com/getsentry/sentry-javascript/issues/17334"}

react-profiling0
react-import-mapreact,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-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:8f8d8e10-011e-5573-7d9c-b68f4d1f1a88
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id96B0:33251C:7118A0:9DF4F4:6B05C404
html-safe-nonce23d79002859e1c6b3a991732edd3214458fe105f8724ed80dc939a8e837704ff
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5NkIwOjMzMjUxQzo3MTE4QTA6OURGNEY0OjZCMDVDNDA0IiwidmlzaXRvcl9pZCI6IjM1NjE0NDkzNzU0MTI4OTY3NzIiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ==
visitor-hmaca598948ce54776759feb72448b2a64d1c1c3f6ca7d62c8dbdb5c3f13b6e4a47b
hovercard-subject-tagissue:3296017063
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/getsentry/sentry-javascript/17334/issue_layout
twitter:imagehttps://opengraph.githubassets.com/ab5210dddf08bec5824ac67a17f07e92f9f1c2968002c213911d9641645377cd/getsentry/sentry-javascript/issues/17334
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/ab5210dddf08bec5824ac67a17f07e92f9f1c2968002c213911d9641645377cd/getsentry/sentry-javascript/issues/17334
og:image:altDescription Deploying @sentry/react-router to Cloudflare Workers is currently not supported out of the box. However, this issue provides a workaround for making it work. Support renderToReadableStr...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernames1gr1d
hostnamegithub.com
expected-hostnamegithub.com
None13b1c5df76a26b2d8420784ae7f9fb9c438fc6cb0c95a689d26fb49879d8e556
turbo-cache-controlno-preview
go-importgithub.com/getsentry/sentry-javascript git https://github.com/getsentry/sentry-javascript.git
octolytics-dimension-user_id1396951
octolytics-dimension-user_logingetsentry
octolytics-dimension-repository_id3328572
octolytics-dimension-repository_nwogetsentry/sentry-javascript
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id3328572
octolytics-dimension-repository_network_root_nwogetsentry/sentry-javascript
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
releasebcf1e3e7f14567fd89b0218ee06dd0aad8f1d288
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/getsentry/sentry-javascript/issues/17334#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-javascript%2Fissues%2F17334
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fgetsentry%2Fsentry-javascript%2Fissues%2F17334
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=getsentry%2Fsentry-javascript
Reloadhttps://github.com/getsentry/sentry-javascript/issues/17334
Reloadhttps://github.com/getsentry/sentry-javascript/issues/17334
Reloadhttps://github.com/getsentry/sentry-javascript/issues/17334
getsentryhttps://github.com/getsentry
sentry-javascripthttps://github.com/getsentry/sentry-javascript
Codehttps://github.com/getsentry/sentry-javascript
Issues329 (329)https://github.com/getsentry/sentry-javascript/issues
Pull requests56 (56)https://github.com/getsentry/sentry-javascript/pulls
Discussionshttps://github.com/getsentry/sentry-javascript/discussions
Actionshttps://github.com/getsentry/sentry-javascript/actions
Security and quality7 (7)https://github.com/getsentry/sentry-javascript/security
Insightshttps://github.com/getsentry/sentry-javascript/insights
https://github.com/getsentry/sentry-javascript
New issuehttps://github.com/login?return_to=https://github.com/getsentry/sentry-javascript/issues/17334
New issuehttps://github.com/login?return_to=https://github.com/getsentry/sentry-javascript/issues/17334
#17145https://github.com/getsentry/sentry-javascript/pull/17145
[React-Router Framework]: Add Cloudflare supporthttps://github.com/getsentry/sentry-javascript/issues/17334#top
#17145https://github.com/getsentry/sentry-javascript/pull/17145
https://github.com/onurtemizkan
React Router Frameworkhttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22React%20Router%20Framework%22
https://github.com/s1gr1d
s1gr1dhttps://github.com/s1gr1d
on Aug 6, 2025https://github.com/getsentry/sentry-javascript/issues/17334#issue-3296017063
renderToPipeableStreamhttps://github.com/getsentry/sentry-javascript/blob/ac57eb17ad3db93f7d24335e39d85211cb1e068f/packages/react-router/src/server/createSentryHandleRequest.tsx#L96
herehttps://github.com/getsentry/sentry-javascript/blob/ac57eb17ad3db93f7d24335e39d85211cb1e068f/packages/react-router/src/server/wrapSentryHandleRequest.ts#L80
https://github.com/apps/linear
linearhttps://github.com/apps/linear
on Aug 6, 2025https://github.com/getsentry/sentry-javascript/issues/17334#issuecomment-3158765226
Linearhttps://linear.app
JS-832 [react-router]: Add Cloudflare supporthttps://linear.app/getsentry/issue/JS-832/react-router-add-cloudflare-support
s1gr1dhttps://github.com/s1gr1d
React Router Frameworkhttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22React%20Router%20Framework%22
on Aug 6, 2025https://github.com/getsentry/sentry-javascript/issues/17334#event-19009462619
s1gr1dhttps://github.com/s1gr1d
on Aug 6, 2025https://github.com/getsentry/sentry-javascript/issues/17334#event-19009466204
onurtemizkanhttps://github.com/onurtemizkan
on Aug 6, 2025https://github.com/getsentry/sentry-javascript/issues/17334#event-19009728362
chargomehttps://github.com/chargome
completedhttps://github.com/getsentry/sentry-javascript/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
#17145https://github.com/getsentry/sentry-javascript/pull/17145
on Aug 6, 2025https://github.com/getsentry/sentry-javascript/issues/17334#event-19010570955
https://github.com/apps/github-actions
github-actionshttps://github.com/apps/github-actions
on Aug 6, 2025https://github.com/getsentry/sentry-javascript/issues/17334#issuecomment-3160980102
GitHub Actionshttps://help.github.com/en/actions
#17145https://github.com/getsentry/sentry-javascript/pull/17145
10.2.0 releasehttps://github.com/getsentry/sentry-javascript/releases/tag/10.2.0
Sign up for freehttps://github.com/signup?return_to=https://github.com/getsentry/sentry-javascript/issues/17334
Sign in to commenthttps://github.com/login?return_to=https://github.com/getsentry/sentry-javascript/issues/17334
onurtemizkanhttps://github.com/onurtemizkan
React Router Frameworkhttps://github.com/getsentry/sentry-javascript/issues?q=state%3Aopen%20label%3A%22React%20Router%20Framework%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Response headers:
Servergithub.com
Content-Typetext/html; charset=utf-8
Cache-Controlmax-age=0, private, must-revalidate

Viewport: width=device-width


URLs of crawlers that visited me.