Skip to content

fix(oxc): keep format failures in the inspector - #659

Draft
SaKaNa-Y wants to merge 1 commit into
vitejs:mainfrom
SaKaNa-Y:fix/oxc-format-error-recovery
Draft

SaKaNa-Y wants to merge 1 commit into
vitejs:mainfrom
SaKaNa-Y:fix/oxc-format-error-recovery

Conversation

@SaKaNa-Y

@SaKaNa-Y SaKaNa-Y commented Dec 1, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

When Oxfmt finds a syntax error during Run Format, the Oxc error screen replaces the entire panel. Even after fixing the source file, the user must reload the panel to see previous results or run the formatter again.

The Run Format dialog now asks the RPC to return formatter errors so it can show the diagnostic and keep the Format page usable. If the user dismisses the dialog before the run fails, the diagnostic appears above the format history.

- Oxfmt command fails → RPC rejects → Oxc replaces the panel with its error screen
+ Oxfmt command fails → RPC returns the diagnostic → Format shows it where the user can retry

Evidence

  • Before: In Chromium, running Check on export const unfinished = ; removed the Oxc navigation and the Run Format button.
    After: With the same file, Check and Write both showed Unexpected token at src/unfinished.js:1:27. Previous results stayed accessible. After correcting the file, Check passed without a reload.
  • Reopened dialog: A failed Write appeared above the history and left the new Check dialog open. A successful Check refreshed the history and preserved the Write selection in the new dialog.
  • RPC tests: Six new command-error assertions failed before the fix. All 17 Run Format tests passed with the fix, including the case where Oxfmt writes the file but saving its history entry fails.

Merge Danger

Door: Two-way. Reverting this change requires no history migration.

Blast Radius: Oxc. Only the Run Format dialog requests command errors as results. Treating a disconnect or a history save failure as a formatter error could mislead the user about the connection or the file on disk. In Chromium, stopping Vite showed the connection screen. When Oxfmt changed a file and saving its history entry failed, Oxc showed the storage error.

Return formatter command errors to the Run Format dialog when requested. Keep the diagnostic beside the history if the user dismisses the dialog, and keep a late result associated with its original run.

Preserve the existing RPC rejection for default callers and for history storage failures after Oxfmt has finished.
@pkg-pr-new

pkg-pr-new Bot commented Dec 1, 2026

Copy link
Copy Markdown

Open in StackBlitz

@vitejs/devtools

npm i https://pkg.pr.new/vitejs/devtools/@vitejs/devtools@659

@vitejs/devtools-kit

npm i https://pkg.pr.new/vitejs/devtools/@vitejs/devtools-kit@659

@vitejs/devtools-oxc

npm i https://pkg.pr.new/vitejs/devtools/@vitejs/devtools-oxc@659

@vitejs/devtools-rolldown

npm i https://pkg.pr.new/vitejs/devtools/@vitejs/devtools-rolldown@659

@vitejs/devtools-vite

npm i https://pkg.pr.new/vitejs/devtools/@vitejs/devtools-vite@659

@vitejs/devtools-vite-task

npm i https://pkg.pr.new/vitejs/devtools/@vitejs/devtools-vite-task@659

@vitejs/devtools-vitest

npm i https://pkg.pr.new/vitejs/devtools/@vitejs/devtools-vitest@659

commit: fb9bb3c

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.

1 participant