Skip to content

fix(v10/cloudflare): auto-instrument when wrangler main is a package - #25430

Merged
nicohrubec merged 7 commits into
v10from
backport/v10/cloudflare-vite-package-main
Oct 16, 2026
Merged

nicohrubec merged 7 commits into
v10from
backport/v10/cloudflare-vite-package-main

Conversation

@sentry-junior

@sentry-junior sentry-junior Bot commented Oct 16, 2026

Copy link
Copy Markdown
Contributor

Backport of: #25343

Differences to the original PR

  • packages/cloudflare/src/vite/transform.ts: on v10, a local class already wrapped by a named export keeps its binding (which now points at the wrapped class), so export { Foo as default } stays as written instead of being re-pointed at a wrapper name.
  • packages/cloudflare/src/vite/autoInstrument.ts, tests and the cloudflare-autoinstrument-package-entry e2e app: small adjustments to fit v10's code layout.

Heads-up: this conflicts with #25407 (backport of #25345) in packages/cloudflare/src/vite/transform.ts and its test. Whichever lands second needs a rebase.

This branch was prepared by the v10 backport automation, which was blocked at PR creation; it's opened manually now.

via Jan Peer Stöcklmair.

--

View Junior Session in Sentry

@github-actions

github-actions Bot commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 28.21 kB added added
@sentry/browser - with treeshaking flags 26.66 kB added added
@sentry/browser (incl. Tracing) 47.23 kB added added
@sentry/browser (incl. Tracing + Span Streaming) 49.03 kB added added
@sentry/browser (incl. Tracing, Profiling) 52 kB added added
@sentry/browser (incl. Tracing, Replay) 86.64 kB added added
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 76.27 kB added added
@sentry/browser (incl. Tracing, Replay with Canvas) 91.35 kB added added
@sentry/browser (incl. Tracing, Replay, Feedback) 103.97 kB added added
@sentry/browser (incl. Feedback) 45.38 kB added added
@sentry/browser (incl. sendFeedback) 33.01 kB added added
@sentry/browser (incl. FeedbackAsync) 38.14 kB added added
@sentry/browser (incl. Metrics) 29.31 kB added added
@sentry/browser (incl. Logs) 29.55 kB added added
@sentry/browser (incl. Metrics & Logs) 30.22 kB added added
@sentry/react 30.02 kB added added
@sentry/react (incl. Tracing) 49.53 kB added added
@sentry/vue 34.1 kB added added
@sentry/vue (incl. Tracing) 49.61 kB added added
@sentry/svelte 28.24 kB added added
CDN Bundle 30.62 kB added added
CDN Bundle (incl. Tracing) 49.18 kB added added
CDN Bundle (incl. Logs, Metrics) 32.19 kB added added
CDN Bundle (incl. Tracing, Logs, Metrics) 50.49 kB added added
CDN Bundle (incl. Replay, Logs, Metrics) 71.62 kB added added
CDN Bundle (incl. Tracing, Replay) 86.87 kB added added
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 88.16 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback) 92.68 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 93.97 kB added added
CDN Bundle - uncompressed 91 kB added added
CDN Bundle (incl. Tracing) - uncompressed 148.26 kB added added
CDN Bundle (incl. Logs, Metrics) - uncompressed 95.71 kB added added
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 152.24 kB added added
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 221.06 kB added added
CDN Bundle (incl. Tracing, Replay) - uncompressed 268.08 kB added added
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 272.05 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 281.78 kB added added
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 285.74 kB added added
@sentry/nextjs (client) 52.1 kB added added
@sentry/sveltekit (client) 47.66 kB added added
@sentry/core/server 81.61 kB added added
@sentry/core/browser 67.69 kB added added
@sentry/node-core 64.01 kB added added
@sentry/node 127.21 kB added added
@sentry/node (incl. diagnostics channel injection) 171.4 kB added added
@sentry/node/import (ESM hook with diagnostics-channel injection) 166 B added added
@sentry/node/light 52.05 kB added added
@sentry/node - without tracing 75.79 kB added added
@sentry/aws-serverless 84.96 kB added added
@sentry/cloudflare (withSentry) - minified 204.93 kB added added
@sentry/cloudflare (withSentry) 505.2 kB added added

@nicohrubec
nicohrubec marked this pull request as ready for review October 16, 2026 09:13
@nicohrubec
nicohrubec requested a review from a team as a code owner October 16, 2026 09:13
@nicohrubec
nicohrubec requested review from JPeer264 and mydea and removed request for a team October 16, 2026 09:13
@nicohrubec
nicohrubec marked this pull request as draft October 16, 2026 09:13
@nicohrubec
nicohrubec marked this pull request as ready for review October 16, 2026 09:23
@nicohrubec
nicohrubec enabled auto-merge (squash) October 16, 2026 09:23

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread packages/cloudflare/src/vite/transform.ts
sentry-junior Bot and others added 2 commits October 16, 2026 09:37
…specifier wraps it

A specifier like `export { Impl as MyDO }` pointing at an `export class Impl` renamed the
class in place without stripping `export`, leaking `__SENTRY_ORIGINAL_Impl__` as a public
export and dropping `Impl`. With the specifier before the class, the class could also be
wrapped twice into duplicate bindings.

Declaration exports are now handled before specifier exports, and an `export class` left
unwrapped by its own export gets a wrapper bound right after the class that the specifier is
re-pointed at.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit ce0ad9f. Configure here.

Comment thread packages/cloudflare/src/vite/transform.ts
…es as auto-wrapped

A WorkerEntrypoint wrapped in place and exported via `export { Foo as default }` was never
recorded under the default export, so same-worker bindings targeting the default entrypoint
were left out of `rpcTracePropagationBindings`. Record `default` specifiers as the default
export on every class-specifier path.
@nicohrubec
nicohrubec merged commit c68e630 into v10 Oct 16, 2026
86 checks passed
@nicohrubec
nicohrubec deleted the backport/v10/cloudflare-vite-package-main branch October 16, 2026 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants