From 8c520a7c6e4d41e4e536c4dc787a5c34ac1fe76d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20R=C3=B6ssner?= Date: Sun, 5 Apr 2026 20:22:03 +0200 Subject: [PATCH 1/2] docs: soften troubleshooting claims around vite config loading --- docs/guide/troubleshooting.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/docs/guide/troubleshooting.md b/docs/guide/troubleshooting.md index 51735f49eb..ec171f026d 100644 --- a/docs/guide/troubleshooting.md +++ b/docs/guide/troubleshooting.md @@ -22,6 +22,39 @@ If you are migrating an existing project and it still depends on older Vite or V The Oxlint type checker path powered by `tsgolint` does not support `baseUrl`, so Vite+ skips `typeAware` and `typeCheck` when that setting is present. + +## `vp lint` / `vp fmt` may fail to read `vite.config.ts` + +`vp lint`, `vp fmt`, and the Oxc VS Code extension all read the `lint` / `fmt` blocks from `vite.config.ts`. Today that support has important limitations. + +### What is currently supported + +- Static object export: + - `export default { ... }` + - `export default defineConfig({ ... })` + +### What can fail in current integrations + +- Functional or async config: + - `defineConfig((env) => ({ ... }))` + - `defineConfig(async (env) => ({ ... }))` +- Config files that rely on Vite transform/bundling behavior to execute. + +In scenarios reported in issue #930, Oxc-side integrations that read `vite.config.ts` can behave closer to native ESM loading (similar to Vite `--configLoader native`) than Vite's bundled default loader. That means configs depending on bundling/transforms can fail to load for lint/fmt/editor paths. See: https://github.com/voidzero-dev/vite-plus/issues/930 + +### Workarounds + +- Prefer a static `defineConfig({ ... })` export when you need `lint` / `fmt` in `vite.config.ts`. +- Avoid Node-specific globals (`__dirname` in ESM), unresolved TS-only imports, or JSON imports without import attributes in config code used by lint/fmt. +- If needed, keep `.oxlintrc.*` / `.oxfmtrc.*` as temporary fallback while this integration behavior is being improved. + +### VS Code multi-root workspace note + +If VS Code has multiple folders open, the shared Oxc language server may pick a different workspace than expected. That can make it look like `vite.config.ts` support is missing. + +- Confirm the extension is using the intended workspace. +- Confirm the workspace resolves to a recent Oxc/Oxlint/Oxfmt toolchain. + ## `vp build` does not run my build script Unlike package managers, built-in commands cannot be overwritten. If you are trying to run a `package.json` script use `vp run build` instead. From 7a60d625e44f8e763d85f60481565348f283ff59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20R=C3=B6ssner?= Date: Sun, 5 Apr 2026 21:14:54 +0200 Subject: [PATCH 2/2] Added reference and hint MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Jakob Rössner --- docs/guide/troubleshooting.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guide/troubleshooting.md b/docs/guide/troubleshooting.md index ec171f026d..306bf83655 100644 --- a/docs/guide/troubleshooting.md +++ b/docs/guide/troubleshooting.md @@ -46,7 +46,7 @@ In scenarios reported in issue #930, Oxc-side integrations that read `vite.confi - Prefer a static `defineConfig({ ... })` export when you need `lint` / `fmt` in `vite.config.ts`. - Avoid Node-specific globals (`__dirname` in ESM), unresolved TS-only imports, or JSON imports without import attributes in config code used by lint/fmt. -- If needed, keep `.oxlintrc.*` / `.oxfmtrc.*` as temporary fallback while this integration behavior is being improved. +- If needed, keep `.oxlintrc.*` / `.oxfmtrc.*` as temporary fallback, [although we do not recommend doing this normally](/guide/lint##configuration), while this integration behavior is being improved. ### VS Code multi-root workspace note