Describe the bug
On Windows, running vp run -r lint (or vp lint for a workspace package) in a pnpm monorepo fails with:
Failed to find tsgolint executable: OXLINT_TSGOLINT_PATH points to
'.\node_modules\.pnpm\vite-plus@0.1.22_...\node_modules\vite-plus\node_modules\.bin\tsgolint.cmd'
which does not exist
The tsgolint executable does exist, the path is just wrong. lint() computes OXLINT_TSGOLINT_PATH as a path relative to process.cwd() of the launcher (the repo root under vp run -r), but oxlint is then spawned with its cwd set to the workspace package directory. The relative .\node_modules\.pnpm\... therefore resolves against packages/<pkg>/, where no .pnpm directory exists (in a pnpm workspace, .pnpm lives only at the repo root).
Root cause
In dist/bin.js, lint() resolves the correct absolute path to tsgolint, then downgrades it to a relative path before exporting it:
if (!oxlintTsgolintPath) throw new Error("Unable to resolve oxlint-tsgolint executable, ...");
const relativePath = relative(process.cwd(), oxlintTsgolintPath);
oxlintTsgolintPath = /^[a-zA-Z]:/.test(relativePath) ? relativePath : `.\\${relativePath}`;
oxlintTsgolintPath is already a valid absolute path at this point. The relative conversion assumes oxlint will run with the same cwd as lint(), which is not true for workspace runs: oxlint receives a path that is relative to the wrong base directory.
(For confirmation: the error string itself is emitted by the oxlint binary, which is correctly reporting that the path it was handed does not exist. The bad value originates here in vite-plus.)
Suggested fix
Keep the resolved absolute path instead of converting it to a launcher-relative path:
if (!oxlintTsgolintPath) throw new Error("Unable to resolve oxlint-tsgolint executable, ...");
// keep the absolute path: oxlint may be spawned with a different cwd (e.g. the workspace
// package dir under `vp run -r`), where a root-relative path would not resolve.
i.e. drop the two relativePath lines. If a relative path is required for some other reason, it should be computed against the directory oxlint is actually spawned in, not the launcher's process.cwd().
Workaround
A local pnpm patch of vite-plus@0.1.22 that removes the relative conversion makes vp lint work correctly across all workspace packages (or use WSL).
Steps to reproduce
- pnpm workspace with a package under
packages/lib (its own lint script calling vp lint).
.pnpm exists only at the repo root (standard pnpm layout).
- On Windows, run
vp run -r lint from the repo root.
- Lint fails with the
OXLINT_TSGOLINT_PATH points to '...' which does not exist error.
Only triggers on process.platform === "win32" (the relative conversion is Windows-only).
System Info
- vite-plus: 0.1.22 (also present unchanged in latest 0.1.24
- OS: Windows 11
- Node: v24.15.0
- pnpm: 10.25.0
- oxlint 1.63.0 / oxlint-tsgolint 0.22.1
Validations
Describe the bug
On Windows, running
vp run -r lint(orvp lintfor a workspace package) in a pnpm monorepo fails with:The
tsgolintexecutable does exist, the path is just wrong.lint()computesOXLINT_TSGOLINT_PATHas a path relative toprocess.cwd()of the launcher (the repo root undervp run -r), but oxlint is then spawned with its cwd set to the workspace package directory. The relative.\node_modules\.pnpm\...therefore resolves againstpackages/<pkg>/, where no.pnpmdirectory exists (in a pnpm workspace,.pnpmlives only at the repo root).Root cause
In
dist/bin.js,lint()resolves the correct absolute path totsgolint, then downgrades it to a relative path before exporting it:oxlintTsgolintPathis already a valid absolute path at this point. The relative conversion assumes oxlint will run with the same cwd aslint(), which is not true for workspace runs: oxlint receives a path that is relative to the wrong base directory.(For confirmation: the error string itself is emitted by the
oxlintbinary, which is correctly reporting that the path it was handed does not exist. The bad value originates here in vite-plus.)Suggested fix
Keep the resolved absolute path instead of converting it to a launcher-relative path:
i.e. drop the two
relativePathlines. If a relative path is required for some other reason, it should be computed against the directory oxlint is actually spawned in, not the launcher'sprocess.cwd().Workaround
A local
pnpm patchofvite-plus@0.1.22that removes the relative conversion makesvp lintwork correctly across all workspace packages (or use WSL).Steps to reproduce
packages/lib(its ownlintscript callingvp lint)..pnpmexists only at the repo root (standard pnpm layout).vp run -r lintfrom the repo root.OXLINT_TSGOLINT_PATH points to '...' which does not existerror.Only triggers on
process.platform === "win32"(the relative conversion is Windows-only).System Info
Validations