Skip to content

fix(oxlint): guard runOxlint against spawn errors (#679)#730

Open
maiolica wants to merge 1 commit into
fi3ework:mainfrom
maiolica:fix/oxlint-spawn-error
Open

fix(oxlint): guard runOxlint against spawn errors (#679)#730
maiolica wants to merge 1 commit into
fi3ework:mainfrom
maiolica:fix/oxlint-spawn-error

Conversation

@maiolica

@maiolica maiolica commented May 29, 2026

Copy link
Copy Markdown

What

Hardens runOxlint against spawn failures so a failed oxlint invocation
can no longer crash the Vite dev server.

runOxlint calls node:child_process.exec but doesn't handle:

  • synchronous throws from exec() itself, or
  • async 'error' events emitted on the returned ChildProcess (these
    fire before the exit callback runs).

In large pnpm monorepos where oxlint is re-run on every file change, the
spawn can intermittently fail (e.g. resource pressure under a flurry of
changes). The unhandled error currently takes down the whole dev server.

Change

Wrap the exec() call in try/catch and attach a child.on('error', ...)
listener. Both paths resolve to an empty diagnostics array, which the rest
of the checker already treats as a clean run — so a transient spawn failure
is silently swallowed and the next run can succeed.

Notes

Fixes the second issue reported in #679. The first issue in that thread
(file:// URI handling in normalizePath) was already addressed by #714.

This mirrors a verified pnpm patch running in production.

Closes #679

@netlify

netlify Bot commented May 29, 2026

Copy link
Copy Markdown

Deploy Preview for vite-plugin-checker ready!

Name Link
🔨 Latest commit 03d395a
🔍 Latest deploy log https://app.netlify.com/projects/vite-plugin-checker/deploys/6a18e23a51056a00076f65f3
😎 Deploy Preview https://deploy-preview-730--vite-plugin-checker.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@pkg-pr-new

pkg-pr-new Bot commented May 29, 2026

Copy link
Copy Markdown

Open in StackBlitz

npm i https://pkg.pr.new/vite-plugin-checker@730

commit: 03d395a

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Oxlint checker: file:// URIs break diagnostics, spawn EBADF crash on file change

1 participant