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
{{ message }}
Repository navigation
vitest list loses the error details when a test file fails to parse #11150
--no-static-parse prints the real error for the same file: the parse diagnostic with its code frame, then Plugin: vite:oxc and File: ....
serializeError in packages/vitest/src/node/ast-collect.ts reads e.text and e.location from each entry of a Vite transform error. Those are esbuild's field names, and the function was written that way in fdeb2f4, when esbuild was the transformer. Vite 8 uses oxc, whose entries carry message and loc instead, so both reads return undefined. printErrorMessage then sees no message and dumps the raw object.
The runtime path does not build these errors by hand. It wraps the transform in handleRollupError, which keeps plugin, id, loc and frame under __vitest_rollup_error__ for the printer. Static collection can reuse that.
Resolve errors are unaffected. They carry pluginCode but no errors array, so they never reach that branch.
I have a fix and tests for it, and will open a PR.
Activity
fix: keep parse error details in static collection (fix #11150) (#11151)