Title: cloudflare: Build-time instrumentation does not run in vite dev · Issue #25765 · getsentry/sentry-javascript · GitHub
Open Graph Title: cloudflare: Build-time instrumentation does not run in vite dev · Issue #25765 · getsentry/sentry-javascript
X Title: cloudflare: Build-time instrumentation does not run in vite dev · Issue #25765 · getsentry/sentry-javascript
Description: With sentryCloudflareVitePlugin, integrations added at build time (e.g. hono, graphql, ai, @anthropic-ai/sdk) send no spans in vite dev. Runtime instrumentation such as D1 works. Two causes: Vite's dependency optimizer pre-bundles these ...
Open Graph Description: With sentryCloudflareVitePlugin, integrations added at build time (e.g. hono, graphql, ai, @anthropic-ai/sdk) send no spans in vite dev. Runtime instrumentation such as D1 works. Two causes: Vite's...
X Description: With sentryCloudflareVitePlugin, integrations added at build time (e.g. hono, graphql, ai, @anthropic-ai/sdk) send no spans in vite dev. Runtime instrumentation such as D1 works. Two causes: Vite...
Opengraph URL: https://github.com/getsentry/sentry-javascript/issues/25765
X: @github
Domain: github.com
IPv4 address: 140.82.114.4
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"cloudflare: Build-time instrumentation does not run in vite dev","articleBody":"With `sentryCloudflareVitePlugin`, integrations added at build time (e.g. `hono`, `graphql`, `ai`, `@anthropic-ai/sdk`) send no spans in `vite dev`. Runtime instrumentation such as D1 works.\n\nTwo causes:\n\n* Vite's dependency optimizer pre-bundles these packages into `node_modules/.vite/deps_*/`, and the orchestrion transform does not run on optimized deps.\n* When a package is excluded from `optimizeDeps`, the transform runs but matches nothing: in dev, module ids end with `?v=\u003chash>`, and the file matcher compares paths exactly.\n\nWith `optimizeDeps.exclude` and the query removed from the id, dev sends `hono` and `graphql` spans. Excluding `ai` is not possible, because its CJS deps then fail with `module is not defined`.\n\nNode + Vite is not affected, because Vite SSR dev does not pre-bundle deps.\n\n### Reproduction\n\n[https://github.com/andreiborza/cf-vite-d1](\u003chttps://github.com/andreiborza/cf-vite-d1>)\n\n1. `pnpm install && pnpm run db:init`, then put `SENTRY_DSN` and `OPENROUTER_API_KEY` in `.env`\n2. `pnpm start`, then `pnpm run try:hono`, `try:graphql`, `try:weather` or `try:anthropic`: no integration spans\n3. `pnpm run build && pnpm run preview`, then call the same routes on port 4173: hono, graphql and `gen_ai.*` spans are sent\n\nRelated: getsentry/sentry-javascript#22857, getsentry/sentry-javascript#25677","author":{"url":"https://github.com/andreiborza","@type":"Person","name":"andreiborza"},"datePublished":"2026-10-27T15:07:19Z","url":"https://github.com/getsentry/sentry-javascript/issues/25765"}
| 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:1a051349-40d1-b35c-4934-357641f6ef7c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E8DA:3DD82D:38E817:4D5E34:6B0438D5 |
| html-safe-nonce | 21f8ab1b56814f760f48220a7d3d06d649f3d67dfd11088fdc1ceea472435ab4 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFOERBOjNERDgyRDozOEU4MTc6NEQ1RTM0OjZCMDQzOEQ1IiwidmlzaXRvcl9pZCI6IjQ1MzAyMjk0MDk5NDg2NDU1ODkiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | f6766440a0fc58768e690456a5aca64335fbff8415e1911e4310275758bdc65f |
| hovercard-subject-tag | issue:6061939744 |
| 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/25765/issue_layout |
| twitter:image | https://opengraph.githubassets.com/9b06400417d43b9cc90af87aaacecc3fd9e51208ada4d078de1acca05632ba6b/getsentry/sentry-javascript/issues/25765 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/9b06400417d43b9cc90af87aaacecc3fd9e51208ada4d078de1acca05632ba6b/getsentry/sentry-javascript/issues/25765 |
| og:image:alt | With sentryCloudflareVitePlugin, integrations added at build time (e.g. hono, graphql, ai, @anthropic-ai/sdk) send no spans in vite dev. Runtime instrumentation such as D1 works. Two causes: Vite's... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | andreiborza |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9185ccfefd80c1ff2d9ddcdb0cd2becf46b5a1efbbf30741a895e4bb8de25e64 |
| 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 | 06dc448a76fe4751ac1db26524aefa3aa3e889a8 |
| 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