Minimal reproduction for an issue where vp staged --debug fails when executed from a pre-commit hook.
- vite-plus: 0.2.1
- Node.js: v24.17.0
- Package manager: pnpm
- OS: macOS
-
Clone this repository.
-
Install dependencies.
mise install pnpm install
-
Enable the pre-commit hook.
vp config
-
Modify any file and stage the changes.
echo "test" >> README.md git add .
-
Run commit.
git commit -m "test"
$ git commit -m "test"
node:internal/fs/promises:640
return new FileHandle(await PromisePrototypeThen(
^
Error: ENOENT: no such file or directory, open '/Users/rokuosan/repo/github.com/rokuosan/repro-vp-staged-debug/node_modules/.pnpm/vite-plus@0.2.1_@types+node@25.9.4_jiti@2.7.0_typescript@6.0.3_vite@8.0.16_@types+node@_22c8376b2772f074fc8311a0feee09c0/node_modules/vite-plus/dist/package.json'
at async open (node:internal/fs/promises:640:25)
at async Object.readFile (node:internal/fs/promises:1290:14)
at async getVersion (file:///Users/rokuosan/repo/github.com/rokuosan/repro-vp-staged-debug/node_modules/.pnpm/vite-plus@0.2.1_@types+node@25.9.4_jiti@2.7.0_typescript@6.0.3_vite@8.0.16_@types+node@_22c8376b2772f074fc8311a0feee09c0/node_modules/vite-plus/dist/staged/bin.js:6490:20)
at async lintStaged (file:///Users/rokuosan/repo/github.com/rokuosan/repro-vp-staged-debug/node_modules/.pnpm/vite-plus@0.2.1_@types+node@25.9.4_jiti@2.7.0_typescript@6.0.3_vite@8.0.16_@types+node@_22c8376b2772f074fc8311a0feee09c0/node_modules/vite-plus/dist/staged/bin.js:6542:59)
at async file:///Users/rokuosan/repo/github.com/rokuosan/repro-vp-staged-debug/node_modules/.pnpm/vite-plus@0.2.1_@types+node@25.9.4_jiti@2.7.0_typescript@6.0.3_vite@8.0.16_@types+node@_22c8376b2772f074fc8311a0feee09c0/node_modules/vite-plus/dist/staged/bin.js:6747:18 {
errno: -2,
code: 'ENOENT',
syscall: 'open',
path: '/Users/rokuosan/repo/github.com/rokuosan/repro-vp-staged-debug/node_modules/.pnpm/vite-plus@0.2.1_@types+node@25.9.4_jiti@2.7.0_typescript@6.0.3_vite@8.0.16_@types+node@_22c8376b2772f074fc8311a0feee09c0/node_modules/vite-plus/dist/package.json'
}
Node.js v24.17.0
VITE+ - pre-commit script failed (code 1)