Skip to content

fix(server-utils): Transform modules once when two Sentry Vite plugins add orchestrion - #25043

Draft
JPeer264 wants to merge 1 commit into
developfrom
jp/orchestrion-vite-plugin-dedupe
Draft

JPeer264 wants to merge 1 commit into
developfrom
jp/orchestrion-vite-plugin-dedupe

Conversation

@JPeer264

@JPeer264 JPeer264 commented Oct 5, 2026

Copy link
Copy Markdown
Member

sentryCloudflareVitePlugin and a framework's Sentry Vite plugin, such as sentryReactRouter, both add the orchestrion Vite plugin. On Cloudflare, every instrumented module was then transformed twice, and the build failed because the injected orchestrionModuleInjected snippet was declared twice. Apps had to set buildTimeInstrumentation: false on the framework plugin.

The plugin is now named sentry-orchestrion, like the Bun plugin. In configResolved, an instance that finds an earlier plugin with that name in the same build skips the transform and the externalized-modules warning. The name lookup also works when the two SDKs bring different copies of @sentry/server-utils. The diagnostics banner that both instances still add is idempotent.

react-router-8-framework drops the workaround from its Cloudflare config, so the Cloudflare e2e variant now builds with both plugins.

Part of #24836

🤖 Generated with Claude Code

…s add orchestrion

`sentryCloudflareVitePlugin` and a framework plugin such as
`sentryReactRouter` both add the orchestrion Vite plugin to one build. Both
instances then transform each instrumented module, the second one declares
the injected snippet again, and the build fails with a redeclaration error.
The plugin is now named `sentry-orchestrion`, and an instance that finds an
earlier one in the same build leaves the transform to it.
`react-router-8-framework` no longer needs `buildTimeInstrumentation: false`
in its Cloudflare config.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
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.

1 participant