Registry / devops / vite-doctor

vite-doctor

JSON →
library0.0.2jsnpmunverified

Vite Doctor is a CLI diagnostic tool for Vite, Nuxt, Vue, and Nitro projects. It statically analyzes app code, build configurations, and server handlers to catch framework bugs and misconfigurations before they reach code review. The current stable version is 0.0.2, with a fast release cadence typical of early-stage tools. It differentiates itself by targeting AI-generated code footguns, offering extensible rule presets, flexible CLI flags (--extends, --rules, --framework), and plugin integration for Vite and Nuxt configs. It ships with TypeScript types and supports ESM-only usage.

npm install vite-doctor
INSTALL
IMPORT
SIG · VITE-DOCTOR
V
vite-doctor
devopsjavascriptv0.0.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

defineDoctorConfig
import { defineDoctorConfig } from 'vite-doctor/config'
import { defineDoctorConfig } from 'vite-doctor'
Config function is exported from 'vite-doctor/config', not the main entry.
doctor
import { doctor } from 'vite-doctor'
import doctor from 'vite-doctor'
The 'doctor' export is a named export, not default. ESM-only package; no CommonJS require.
Nuxt module
modules: [['vite-doctor/nuxt', { ... }]]
modules: [['vite-doctor', { ... }]]
Nuxt module path is 'vite-doctor/nuxt', not the main package.

Shows CLI usage with pnpm dlx, Nuxt integration, and Vite plugin configuration with custom rules.

// Run diagnostics from project root pnpm dlx vite-doctor . // Or install and use via Nuxt pnpm add -D vite-doctor pnpm nuxt doctor // With custom rules import { doctor } from 'vite-doctor'; export default { plugins: [ doctor({ config: { rules: { 'vite/define/no-secret-define': 'error', }, }, }), ], };
Debug
Known issues
gotchaThe package requires Node.js >=22.20.0. Using an older Node version will fail with an engine check.
fix
Upgrade Node.js to v22.20.0 or later.
affects: >=0.0.2
gotchaNuxt module path is 'vite-doctor/nuxt', not 'vite-doctor'. Incorrect path results in module not found error.
fix
Use 'vite-doctor/nuxt' in the modules array.
affects: >=0.0.2
gotchaImporting 'defineDoctorConfig' from 'vite-doctor' instead of 'vite-doctor/config' will fail.
fix
Import from 'vite-doctor/config'.
affects: >=0.0.2
gotchaThe package is ESM-only and does not support require(). Using require() will throw a ERR_REQUIRE_ESM error.
fix
Use dynamic import() or set type: 'module' in package.json.
affects: >=0.0.2
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module ... not supported.
Package is ESM-only and cannot be required with CommonJS require().
fix
Use dynamic import() or switch to an ESM context (type: 'module' in package.json).
Cannot find module 'vite-doctor/config' or its corresponding type declarations.
Import path is incorrect; the subpath export may not be recognized.
fix
Ensure you are using 'import { defineDoctorConfig } from 'vite-doctor/config'' (correct casing).
ERR_PNPM_UNSUPPORTED_ENGINE  Unsupported Node.js version.
Package engine requires Node >=22.20.0.
fix
Upgrade Node.js to version 22.20.0 or later.
Upgrade
Version history
0.0.2latest on npm
Audit
Dependencies
viterequiredPeer dependency for Vite plugin functionality
nuxtoptionalOptional peer dependency for Nuxt module (version >=4)
Agent activity
6 hits · last 30 days
node
4
Amazon
2
Resources
vite-doctor — npm install vite-doctor · libregistry