Skip to content

fix(dev): prebundle Void runtime deps the scanner cannot reach - #1035

Draft
TheAlexLichter wants to merge 1 commit into
mainfrom
fix/prebundle-void-runtime-deps
Draft

TheAlexLichter wants to merge 1 commit into
mainfrom
fix/prebundle-void-runtime-deps

Conversation

@TheAlexLichter

Copy link
Copy Markdown
Member

A cold vp dev of a Cloudflare app with a linked void (this workspace or a monorepo) found Void's own runtime dependencies during the first request. Each one reloaded the Worker:

(void_worker) dependency optimized: hono/http-exception
(void_worker) optimized dependencies changed. reloading
(void_worker) dependency optimized: hono/utils/url
(void_worker) optimized dependencies changed. reloading

That's because Vite's dependency scanner never reaches Void's runtime. The generated .void/entry.ts imports the routing runtime by absolute path, which the scanner treats as external. The virtual route table is skipped too, and void/* imports from app code stop at exclude: ['void']. So runtime deps are only prebundled when listed by hand, and that list was out of date.

This PR

The Worker's optimizeDeps.include is now built from three groups:

  • Every Worker: devalue, hono, hono/route and hono/utils/url.
  • Apps using auth, void/live or WebSocket routes: hono/http-exception.
  • Apps with a database: drizzle-orm/sqlite-core, pg-core or mysql-core, matching the dialect.

The flags come from the existing app analysis, so apps without those features get none of the extra prebundles. The shared Pages plugin adds a dev-only client include for void > devalue, which covers React, Vue, Svelte and Solid.
Everything added is a dependency of void, so it's always installed.

Limits

  • The spa playground still finds better-auth/client late on the client but without a reload.
  • An app that imports void/ws/server without a .ws.ts route still finds hono/http-exception late.
  • New runtime modules must be added to the guard test's root list by hand.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Dec 4, 2026 •

Copy link
Copy Markdown

Cloudflare builds and deploys previews for this pull request. Learn more about Cloudflare previews.

Worker Status Deployment Commit
void-cloud Deployed Preview 88883a0

Updated: Dec 4, 2026, 15:05 UTC | Dashboard

@blacksmith-sh

This comment has been minimized.

@TheAlexLichter
TheAlexLichter force-pushed the fix/prebundle-void-runtime-deps branch from 36722a9 to 88883a0 Compare December 4, 2026 15:04

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