You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guide/troubleshooting.md
+33Lines changed: 33 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,6 +22,39 @@ If you are migrating an existing project and it still depends on older Vite or V
22
22
23
23
The Oxlint type checker path powered by `tsgolint` does not support `baseUrl`, so Vite+ skips `typeAware` and `typeCheck` when that setting is present.
24
24
25
+
26
+
## `vp lint` / `vp fmt` may fail to read `vite.config.ts`
27
+
28
+
`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.
29
+
30
+
### What is currently supported
31
+
32
+
- Static object export:
33
+
-`export default { ... }`
34
+
-`export default defineConfig({ ... })`
35
+
36
+
### What can fail in current integrations
37
+
38
+
- Functional or async config:
39
+
-`defineConfig((env) => ({ ... }))`
40
+
-`defineConfig(async (env) => ({ ... }))`
41
+
- Config files that rely on Vite transform/bundling behavior to execute.
42
+
43
+
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
44
+
45
+
### Workarounds
46
+
47
+
- Prefer a static `defineConfig({ ... })` export when you need `lint` / `fmt` in `vite.config.ts`.
48
+
- Avoid Node-specific globals (`__dirname` in ESM), unresolved TS-only imports, or JSON imports without import attributes in config code used by lint/fmt.
49
+
- 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.
50
+
51
+
### VS Code multi-root workspace note
52
+
53
+
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.
54
+
55
+
- Confirm the extension is using the intended workspace.
56
+
- Confirm the workspace resolves to a recent Oxc/Oxlint/Oxfmt toolchain.
57
+
25
58
## `vp build` does not run my build script
26
59
27
60
Unlike package managers, built-in commands cannot be overwritten. If you are trying to run a `package.json` script use `vp run build` instead.
0 commit comments