Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslnode 18–226 runs
build_error
glibcnode 18–226 runs
build_error
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
Inspect
✓ import Inspect from 'vite-plugin-inspect'
✗ const Inspect = require('vite-plugin-inspect')
Default export; v11.0.0+ is ESM-only, so require() will fail.
default
✓ import Inspect from 'vite-plugin-inspect'
✗ import { Inspect } from 'vite-plugin-inspect'
The package exports a default function, not a named export.
type Options
✓ import type { Options } from 'vite-plugin-inspect'
TypeScript users can import the Options type for configuration.
Sets up vite-plugin-inspect with devtools enabled for debugging plugin transformations in dev mode.
// vite.config.ts
import { defineConfig } from 'vite'
import Inspect from 'vite-plugin-inspect'
export default defineConfig({
devtools: true,
plugins: [
Inspect()
],
})
Debug
Known issues
breakingv11.0.0 drops CJS support; package is now ESM-only.fixEnsure your project uses ESM (type: 'module' in package.json or .mjs file extensions). If using CJS, stay on v10.x.
affects: >=11.0.0
breakingv12.x (beta) migrates to @vitejs/devtools and requires Vite v8.0.0+.fixInstall @vitejs/devtools as a dependency and add 'devtools: true' to Vite config. Upgrade Vite to v8+.
affects: >=12.0.0-beta.1
deprecatedv11.0.0 deprecated the CJS build; v10.x had incorrect default exports in CJS.fixIf using CJS with v10.3.0, use `const Inspect = require('vite-plugin-inspect').default` to work around the export issue. affects: >=10.3.0 <11.0.0
gotchaThe 'build' option must be explicitly set to true to inspect transformations during build mode.fixAdd `build: true` to the options object: `Inspect({ build: true })` affects: >=0.0.0
gotchaFor v12.x, the plugin configuration changed: you need to set `devtools: true` or `devtools: { build: { withApp: true } }` in Vite config, not just in the plugin options.fixAdd the `devtools` key to your Vite config object (not the plugin).
affects: >=12.0.0-beta.1
deprecatedv10.x and earlier used 'vite-plugin-inspect' with CJS; default export was not compatible with CJS require.fixUpgrade to v10.3.0+ if you need CJS, or migrate to ESM and use v11.x.
affects: <10.3.0
Errors
Common errors & fixes
Error: Cannot find module 'vite-plugin-inspect'
Package not installed or CJS/ESM mismatch (v11+ is ESM-only).
fixRun `npm install -D vite-plugin-inspect` and ensure your project is ESM (set `type: 'module'` in package.json).
TypeError: (0 , vite_plugin_inspect_1.default) is not a function
Using named import `{ Inspect }` instead of default import with CJS interop in v10.x.
fixUse `import Inspect from 'vite-plugin-inspect'` (ESM) or `const Inspect = require('vite-plugin-inspect').default` (CJS, v10.x only). TypeError: Inspect is not a function
Calling `Inspect()` before the default import resolves; often due to circular dependencies or incorrect import path.
fixVerify import is `import Inspect from 'vite-plugin-inspect'` and the package is installed correctly.
Error: Cannot find module '@vitejs/devtools'
v12.x requires @vitejs/devtools as a separate dependency.
fixRun `npm install -D @vitejs/devtools` and add `devtools: true` to Vite config.
Warning: The 'build' option is not enabled. Build transformations will not be captured.
Inspect() called without `build: true` when running `vite build`.
fixAdd `build: true` to the plugin options: `Inspect({ build: true })`. Audit
Dependencies
viterequiredPeer dependency; the plugin hooks into Vite's plugin system.
@vitejs/devtoolsoptionalRequired for v12.x (beta) to enable devtools integration.