Repository navigation
vp run -r lint fails on Windows in monorepos: OXLINT_TSGOLINT_PATH is set to a root-relative path resolved from the wrong cwd #1747
Description
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 ownlintscript callingvp lint). .pnpmexists only at the repo root (standard pnpm layout).- On Windows, run
vp run -r lintfrom the repo root. - Lint fails with the
OXLINT_TSGOLINT_PATH points to '...' which does not existerror.
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
- Read the Contributing Guidelines.
- Check that there isn't already an issue for the same bug.
- Confirm this is a Vite+ issue and not an upstream issue (Vite, Vitest, tsdown, Rolldown, or Oxc).
- The provided reproduction is a minimal reproducible example.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
Effort
Target date
Start date
Activity
semimikoh commentedon Jun 4, 2026
Hi! I'd like to work on this.
The analysis in the issue looks correct — in
packages/cli/src/resolve-lint.ts, the Windows-onlyrelative(process.cwd(), ...)conversion downgrades an already-resolved absolute path. That breaks when oxlint is spawned with a different cwd than the launcher (the workspace package dir undervp run -r), since the root-relative.\node_modules\.pnpm\...path no longer resolves.I'll open a PR that keeps the resolved absolute path. Could this be assigned to me?
fix(cli): keep absolute tsgolint path for workspace lint runs
fix(cli): keep absolute tsgolint path for workspace lint runs (voidze…
dm4t2 commentedon Jun 5, 2026
Thanks for the quick fix 👍