Skip to content

fix(server-utils): Stop the orchestrion Vite plugin from adding an empty ssr environment - #24552

Open
JPeer264 wants to merge 1 commit into
developfrom
jp/orchestrion-vite-ssr-environment
Open

JPeer264 wants to merge 1 commit into
developfrom
jp/orchestrion-vite-ssr-environment

Conversation

@JPeer264

Copy link
Copy Markdown
Member

I came across this issue while I was experimenting with Vinext on Cloudflare and our Vite plugin

In a build, Vite 6+ adds an ssr environment when the config has a top-level ssr key. The orchestrion plugin always returned ssr.noExternal from its config hook, so Vite created an ssr environment without an entry. A buildApp that builds every environment (for example vite build --app) then failed with "input should not be an html file when building for SSR".

On Vite 6+ the plugin now sets resolve.noExternal per server environment in configEnvironment. The top-level ssr key is only added when the config already has ssr or build.ssr, which keeps Vite 5 SSR builds (Remix v2, SvelteKit) force-bundling the instrumented modules.

…pty ssr environment

In a build, Vite 6+ adds an `ssr` environment when the config has a top-level
`ssr` key. The orchestrion plugin always returned `ssr.noExternal` from its
`config` hook, so Vite created an `ssr` environment without an entry. A
`buildApp` that builds every environment (for example `vite build --app`) then
failed with "input should not be an html file when building for SSR".

On Vite 6+ the plugin now sets `resolve.noExternal` per server environment in
`configEnvironment`. The top-level `ssr` key is only added when the config
already has `ssr` or `build.ssr`, which keeps Vite 5 SSR builds (Remix v2,
SvelteKit) force-bundling the instrumented modules.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@JPeer264
JPeer264 requested a review from timfish September 21, 2026 12:21
@JPeer264 JPeer264 self-assigned this Sep 21, 2026
@JPeer264
JPeer264 requested review from a team as code owners September 21, 2026 12:21
@JPeer264
JPeer264 requested review from isaacs, mydea, nicohrubec and s1gr1d and removed request for a team, isaacs and mydea September 21, 2026 12:21
@github-actions

Copy link
Copy Markdown
Contributor

size-limit report 📦

Path Size % Change Change
@sentry/browser 29.07 kB - -
@sentry/browser - with treeshaking flags 27.34 kB - -
@sentry/browser - with treeshaking flags tracing without tracing 27.24 kB - -
@sentry/browser (incl. Tracing) 50.55 kB - -
@sentry/browser (incl. Tracing + Span Streaming) 50.56 kB - -
@sentry/browser (incl. Tracing, Profiling) 53.55 kB - -
@sentry/browser (incl. Tracing, Replay) 90.09 kB - -
@sentry/browser (incl. Tracing, Replay) - with treeshaking flags 79.18 kB - -
@sentry/browser (incl. Tracing, Replay with Canvas) 94.78 kB - -
@sentry/browser (incl. Tracing, Replay, Feedback) 107.76 kB - -
@sentry/browser (incl. Feedback) 46.6 kB - -
@sentry/browser (incl. sendFeedback) 34.13 kB - -
@sentry/browser (incl. FeedbackAsync) 39.25 kB - -
@sentry/browser (incl. Metrics) 30.08 kB - -
@sentry/browser (incl. Logs) 30.34 kB - -
@sentry/browser (incl. Metrics & Logs) 31 kB - -
@sentry/react 30.82 kB - -
@sentry/react (incl. Tracing) 52.86 kB - -
@sentry/vue 36.33 kB - -
@sentry/vue (incl. Tracing) 52.84 kB - -
@sentry/svelte 29.1 kB - -
CDN Bundle 30.77 kB - -
CDN Bundle (incl. Tracing) 51.06 kB - -
CDN Bundle (incl. Logs, Metrics) 33.02 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) 53.05 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) 73.71 kB - -
CDN Bundle (incl. Tracing, Replay) 88.61 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) 90.54 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) 94.66 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) 96.67 kB - -
CDN Bundle - uncompressed 91.07 kB - -
CDN Bundle (incl. Tracing) - uncompressed 152.44 kB - -
CDN Bundle (incl. Logs, Metrics) - uncompressed 97.64 kB - -
CDN Bundle (incl. Tracing, Logs, Metrics) - uncompressed 158.4 kB - -
CDN Bundle (incl. Replay, Logs, Metrics) - uncompressed 227.05 kB - -
CDN Bundle (incl. Tracing, Replay) - uncompressed 272.01 kB - -
CDN Bundle (incl. Tracing, Replay, Logs, Metrics) - uncompressed 277.95 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback) - uncompressed 285.72 kB - -
CDN Bundle (incl. Tracing, Replay, Feedback, Logs, Metrics) - uncompressed 291.65 kB - -
@sentry/nextjs (client) 55.19 kB - -
@sentry/sveltekit (client) 50.98 kB - -
@sentry/core/server 39.97 kB - -
@sentry/core/browser 13.63 kB - -
@sentry/node 133.33 kB +0.02% +20 B 🔺
@sentry/node/import (ESM hook with diagnostics-channel injection) 82.15 kB - -
@sentry/node - without tracing 89.92 kB +0.03% +19 B 🔺
@sentry/node - without channel injection 112.12 kB +0.02% +17 B 🔺
@sentry/aws-serverless 98.19 kB +0.02% +18 B 🔺
@sentry/cloudflare (withSentry) - minified 204.67 kB - -
@sentry/cloudflare (withSentry) 509.34 kB - -

View base workflow run

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.

2 participants