Skip to content

defineConfig from vite-plus rejects any plugin typed against the real vite package with TS2321 #2269

Description

@filipfalcon

Describe the bug

vite-plus aliases "vite": "npm:@voidzero-dev/vite-plus-core@0.2.6", so its defineConfig is typed against that package's UserConfig/Plugin, while apps and plugin packages (@tailwindcss/vite peers on ^5 || ^6 || ^7 || ^8) type against vite itself. Comparing the two structurally identical Plugin types overflows the checker's depth limit.

Consequence: no vite.config.ts in a Vite+ project can be type-checked, despite vp lint running typeCheck — configs have to go in ignorePatterns.

Reproduction

https://github.com/filipfalcon/mre-vite-plus-defineconfig-typed-plugin-excessive-stack-depth

Steps to reproduce

  1. npm install
  2. npm run check
  3. Observe the error reported against vite.config.ts

System Info

Environment:
  Version  24.18.0
  Source   lts

Tool Paths:
  node  /Users/johndoe/.vite-plus/js_runtime/node/24.18.0/bin/node
  npm   /Users/johndoe/.vite-plus/js_runtime/node/24.18.0/bin/npm
  npx   /Users/johndoe/.vite-plus/js_runtime/node/24.18.0/bin/npx

Local vite-plus:
  vite-plus  Not found

Tools:
  vite             Not found
  rolldown         Not found
  vitest           Not found
  oxfmt            Not found
  oxlint           Not found
  oxlint-tsgolint  Not found
  tsdown           Not found

Environment:
  Package manager  Not found
  Node.js          v24.18.0

Used Package Manager

npm

Logs

Validations

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

Fields

Priority

None yet

Effort

None yet

Target date

None yet

Start date

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions