Skip to content

Commit 1f48b2c

Browse files
leaysgurfengmk2
andauthored
docs: update troubleshooting.md (#1708)
Fixes #930 `vite.config.ts` related issues should be fixed by updating oxlint+oxfmt. Rest issues are already covered by indivisual issue. --------- Co-authored-by: MK (fengmk2) <fengmk2@gmail.com>
1 parent 1549f71 commit 1f48b2c

1 file changed

Lines changed: 1 addition & 27 deletions

File tree

docs/guide/troubleshooting.md

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -25,37 +25,11 @@ The Oxlint type checker path powered by `tsgolint` does not support `baseUrl`.
2525
fix before enabling type-aware linting. If that fix fails or is declined, Vite+
2626
skips `typeAware` and `typeCheck`.
2727

28-
## `vp lint` / `vp fmt` may fail to read `vite.config.ts`
29-
30-
`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.
31-
32-
### What is currently supported
33-
34-
- Static object export:
35-
- `export default { ... }`
36-
- `export default defineConfig({ ... })`
37-
38-
### What can fail in current integrations
39-
40-
- Functional or async config:
41-
- `defineConfig((env) => ({ ... }))`
42-
- `defineConfig(async (env) => ({ ... }))`
43-
- Config files that rely on Vite transform/bundling behavior to execute.
44-
45-
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
46-
47-
### Workarounds
48-
49-
- Prefer a static `defineConfig({ ... })` export when you need `lint` / `fmt` in `vite.config.ts`.
50-
- Avoid Node-specific globals (`__dirname` in ESM), unresolved TS-only imports, or JSON imports without import attributes in config code used by lint/fmt.
51-
- 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.
52-
53-
### VS Code multi-root workspace note
28+
## VS Code extension does not read `vite.config.ts`
5429

5530
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.
5631

5732
- Confirm the extension is using the intended workspace.
58-
- Confirm the workspace resolves to a recent Oxc/Oxlint/Oxfmt toolchain.
5933

6034
## `vp build` does not run my build script
6135

0 commit comments

Comments
 (0)