Repository navigation
Closed as duplicate
Labels
Description
Describe the bug
When I run vp lint in my newly setup Qwik/Vite+ project, I get this error:
VITE+ - The Unified Toolchain for the Web
Failed to parse oxlint configuration file.
× Expected a `lint` field in the default export of C:/Users/USER/Projects/qwikplus/vite.config.ts
But vite.config.ts does contain the lint field. (see repro: https://github.com/Ionaru/qwikplus-vplint-error/blob/b58b3bb44e8ab79c7d8fed66e75df14bf7287993/vite.config.ts#L25)
Running pnpx oxlint works correctly.
Reproduction
https://github.com/Ionaru/qwikplus-vplint-error
Steps to reproduce
git clone https://github.com/Ionaru/qwikplus-vplint-error.gitcd qwikplus-vplint-errorpnpm install --frozen-lockfilevp lint
OR
vp create qwik@beta -- playground qwikplus -i falsecd qwikplus- Edit
tsconfig.json-> set"module"to"esnext" - Edit
vite.config.ts-> addwith { type: "json" }toimport pkg from "./package.json" vp lint
System Info
VITE+ - The Unified Toolchain for the Web
Environment:
Version 24.14.0
Source engines.node
Source Path C:\Users\USER\Projects\qwikplus\package.json
Project Root C:\Users\USER\Projects\qwikplus
Tool Paths:
node C:\Users\USER\.vite-plus\js_runtime\node\24.14.0\node.exe
npm C:\Users\USER\.vite-plus\js_runtime\node\24.14.0\npm.cmd
npx C:\Users\USER\.vite-plus\js_runtime\node\24.14.0\npx.cmd
VITE+ - The Unified Toolchain for the Web
vp v0.1.13
Local vite-plus:
vite-plus v0.1.13
Tools:
vite v8.0.1
rolldown v1.0.0-rc.10
vitest v4.1.0
oxfmt v0.41.0
oxlint v1.56.0
oxlint-tsgolint v0.17.1
tsdown v0.21.4
Environment:
Package manager pnpm v10.32.1
Node.js v24.14.0 (engines.node)Used Package Manager
pnpm
Logs
No Vite+ commands support `--debug` it seems...
- vp lint --debug -> Error: no such flag: --debug, did you mean --deny?
- vp --debug lint -> error: Unexpected argument '--debug'Validations
- Read the Contributing Guidelines.
- Check that there isn't already an issue for the same bug.
- Confirm this is a Vite+ issue and not an upstream issue (Vite, Vitest, tsdown, Rolldown, or Oxc).
- The provided reproduction is a minimal reproducible example.
Metadata
Metadata
Assignees
Labels
Type
Fields
Priority
None yet
Effort
None yet
Target date
None yet
Start date
None yet
Activity
claude commentedon Mar 21, 2026
Analysis
Root Cause
The bug occurs in the following flow when
vp lintis called:vp lintcallsresolveUniversalViteConfig(), which uses Vite's runtime config resolver to loadvite.config.ts— this succeeds and correctly extracts thelintfield.lintis set,cli.rs(lines 253–258) appends-c vite.config.tsto oxlint's arguments.vite.config.tsto find thelintfield.with { type: "json" }), producing the "Expected alintfield in the default export" error.The second reproduction step confirms this: adding
with { type: "json" }to an import is the exact trigger.Relevant Code
packages/cli/binding/src/cli.rslines 253–258: Where vite.config.ts path is passed to oxlintpackages/cli/src/resolve-vite-config.ts: Returns bothconfigFile(path to vite.config.ts) andlint(the already-extracted config object as JSON).Is This Fixable?
Yes. This is fixable on the vite-plus side without waiting for an oxlint fix.
Implementation Plan
The fix is to stop passing
vite.config.tsdirectly to oxlint and instead write a temporary JSON file containing just the extracted lint config:In
cli.rsSynthesizableSubcommand::Linthandler: Whenresolved_vite_config.lintisSome(json_value), instead of passing-c vite.config.ts, serialize the JSON value to a temp file (e.g., a file in the system temp dir) and pass-c <temp_file_path>.Temp file lifecycle: Write the file before spawning oxlint and delete it after oxlint exits. The temp file can be written in a blocking fashion before the child process is spawned and cleaned up via a drop guard.
Fallback: If
resolved_vite_config.lintisNone, don't pass any-cflag (current behavior for the no-lint case).An alternative would be to write the lint config to a deterministically named file (e.g.,
oxlint.json) in the project root — but a temp file avoids polluting the project directory.Potential Concerns
lintvalue fromresolveUniversalViteConfigis already the full JSON-serialized lint config, so no further transformation is needed before writing to a temp file.leaysgur commentedon Mar 23, 2026
The root cause: #930.
defineConfig(() =>; {})-cflag is specifiedAnd:
vite-lintis equivalent tooxlint -c vite.config.tsvite.config.tsas a config with nolintfield errorvite.config.tsbut ignores it