Skip to content

fix(cli): type lazyPlugins to never return undefined - #3598

Open
voidzero-bot[bot] wants to merge 1 commit into
mainfrom
triagebot/fix-3597
Open

voidzero-bot[bot] wants to merge 1 commit into
mainfrom
triagebot/fix-3597

Conversation

@voidzero-bot

@voidzero-bot voidzero-bot Bot commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

lazyPlugins() returned undefined while vite-plus resolved config metadata, and its public type included that undefined. Vite's optional plugins?: PluginOption[] property rejects an explicit undefined under exactOptionalPropertyTypes: true, so the documented defineConfig({ plugins: lazyPlugins(...) }) pattern (also emitted by vp migrate) failed to type-check with TS2345, forcing the lazyPlugins(...) ?? [] workaround.

lazyPlugins now returns an empty array instead of undefined in metadata mode and both overloads are typed PluginOption[]. Internals already normalize the field with config.plugins ?? [], so plugin skipping behavior is unchanged; the pattern now type-checks under exactOptionalPropertyTypes. A compile-time regression assertion in packages/cli/src/__tests__/index.spec.ts fails to build whenever the return type includes undefined again.

Closes #3597

Automated triage bot fix (AI-assisted).

…g compatible with exactOptionalPropertyTypes
@cloudflare-workers-and-pages

Copy link
Copy Markdown

🚀 Deploying Preview to Cloudflare 🚀

Preview URL: https://triagebot-fix-3597-viteplus-dev.voidzero-docs.workers.dev (commit c928029)

This URL reflects your latest Preview deployment

Preview Deployments by commit

Status Deployment URL Commit Updated (UTC) See this deployment's details
  • Build: Success ✅
  • Deployment: Success ✅

View logs ↗
https://49f9f1a1-viteplus-dev.voidzero-docs.workers.dev c928029 2026-11-28T18:23:04.459Z Visit the dashboard ↗

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

lazyPlugins() return type breaks defineConfig under exactOptionalPropertyTypes

0 participants