devtools-oxc: overview fails with "Error: fetch failed" when npm.antfu.dev is unreachable
Describe the bug
Opening the Oxc panel in Vite DevTools fails with Error: fetch failed when https://npm.antfu.dev/oxlint+oxfmt is unreachable from the Node process running vite / vp.
The Overview RPC (devtools-oxc:overview) does an unconditional remote fetch for latest-version comparison. If that request fails, the whole overview query fails and the panel cannot load — even though local Oxlint / Oxfmt (including Vite+ bundled versions) are available.
Reproduction
- Install
@vitejs/devtools+@vitejs/devtools-oxcand enabledevtools: { apply: 'serve' }. - Block or fail access from Node to
https://npm.antfu.dev(common with browser-only VPN / split tunneling / restricted networks). - Run
vp dev/viteand open the Oxc dock panel.
Expected
Overview should still render local toolchain info. Latest-version comparison should be best-effort and skipped on network failure.
Actual
Panel shows Error: fetch failed.
Relevant code
In @vitejs/devtools-oxc Overview RPC:
const [oxlintData, oxfmtData] = await (await fetch("https://npm.antfu.dev/oxlint+oxfmt")).json()
There is no try/catch around this call.
Suggested fix
Wrap the fetch in try/catch (and check response.ok). On failure, continue with local version info and skip / mark unknown the "latest" comparison.
Environment
@vitejs/[email protected]@vitejs/[email protected]- Vite via Vite+ (
[email protected]) - Windows 10, Node 22+
- Browser can open
npm.antfu.dev, but Node/vpprocess could not at the time of failure (VPN split tunneling)