Title: Server runtime optimizer turns on prebundling in Vite's unused Node ssr environment · Issue #412 · voidzero-dev/void · GitHub
Open Graph Title: Server runtime optimizer turns on prebundling in Vite's unused Node ssr environment · Issue #412 · voidzero-dev/void
X Title: Server runtime optimizer turns on prebundling in Vite's unused Node ssr environment · Issue #412 · voidzero-dev/void
Description: Summary In apps where Void owns the workerd runtime, #407's optimizeDeps.include: ['void > email-validator'] goes to every non-client environment. In default (no-framework) mode that includes Vite's built-in Node ssr environment, which t...
Open Graph Description: Summary In apps where Void owns the workerd runtime, #407's optimizeDeps.include: ['void > email-validator'] goes to every non-client environment. In default (no-framework) mode that includes Vite'...
X Description: Summary In apps where Void owns the workerd runtime, #407's optimizeDeps.include: ['void > email-validator'] goes to every non-client environment. In default (no-framework) mode that...
Opengraph URL: https://github.com/voidzero-dev/void/issues/412
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Server runtime optimizer turns on prebundling in Vite's unused Node ssr environment","articleBody":"## Summary\n\nIn apps where Void owns the workerd runtime, #407's `optimizeDeps.include: ['void > email-validator']` goes to every non-client environment. In default (no-framework) mode that includes Vite's built-in Node `ssr` environment, which these apps never use, because the app runs in `void_worker`.\n\n## Cause\n\nVite turns off the dep optimizer for server environments only when `noDiscovery && !include.length`. A non-empty include therefore starts an optimizer for `ssr`, and `DevEnvironment.listen()` waits for it to finish. The result is an extra optimizer pass at dev startup and an extra `node_modules/.vite/deps_ssr` cache directory.\n\nThis contradicts the comment in `createServerRuntimeOptimizerPlugin`, which says forcing an include on a Node environment \"turns on SSR prebundling the framework did not ask for\".\n\nImpact is small: nothing breaks. React pages mode already turns on the `ssr` optimizer, so this mainly affects other no-framework apps.\n\n## Reproduction\n\nOn `playground/spa` (or any API-only app), run `rm -rf node_modules/.vite && vp dev`. `node_modules/.vite/deps_ssr/_metadata.json` now exists and lists `void > email-validator`. Before #407 there was no `deps_ssr`.\n\n## Suggested fix\n\nAdd the include only to the environments the Cloudflare plugin runs in workerd: `void_worker` in default mode, the configured `viteEnvironment` and its child environments for class-a frameworks, and auxiliary workers. Every other non-client environment keeps just `exclude: ['void']`. Add a unit case asserting the default-mode `ssr` environment resolves to `{ optimizeDeps: { exclude: ['void'] } }`.\n","author":{"url":"https://github.com/Brooooooklyn","@type":"Person","name":"Brooooooklyn"},"datePublished":"2026-10-12T10:11:10Z","url":"https://github.com/voidzero-dev/void/issues/412"}
| 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:20e908e1-b596-35d2-f0aa-e151be1aaba4 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | B264:31222B:C5BF:10B8D:6AFBA417 |
| html-safe-nonce | 3d40fd4a9f8dc3c8058156e148d553626b450f2aece50183496a120e79915ddd |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMjY0OjMxMjIyQjpDNUJGOjEwQjhEOjZBRkJBNDE3IiwidmlzaXRvcl9pZCI6IjU5MzQzNjYxNjczMzMwNTM0NjMiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | c4826217f3fa5922503c37f77083fe60ab094d88ab3ad253d3d1aa29471df81d |
| hovercard-subject-tag | issue:5811985996 |
| 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/voidzero-dev/void/412/issue_layout |
| twitter:image | https://opengraph.githubassets.com/8cf75872179add31f259771204aff1691309059f5e01ecfdb1db76b844946a09/voidzero-dev/void/issues/412 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/8cf75872179add31f259771204aff1691309059f5e01ecfdb1db76b844946a09/voidzero-dev/void/issues/412 |
| og:image:alt | Summary In apps where Void owns the workerd runtime, #407's optimizeDeps.include: ['void > email-validator'] goes to every non-client environment. In default (no-framework) mode that includes Vite'... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Brooooooklyn |
| hostname | github.com |
| expected-hostname | github.com |
| None | 03e5090f0cea887cafa036e3af34d7c668d83b5e9e9e03df72a90efb49b69cdf |
| turbo-cache-control | no-preview |
| go-import | github.com/voidzero-dev/void git https://github.com/voidzero-dev/void.git |
| octolytics-dimension-user_id | 149750581 |
| octolytics-dimension-user_login | voidzero-dev |
| octolytics-dimension-repository_id | 1164437080 |
| octolytics-dimension-repository_nwo | voidzero-dev/void |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 1164437080 |
| octolytics-dimension-repository_network_root_nwo | voidzero-dev/void |
| 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 | 41f00295b9a35dca977890ab83b22788ab211dc8 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width