Skip to content

fix(config): name the unknown field when a task config doesn't parse - #815

Open
tlq5l wants to merge 1 commit into
voidzero-dev:mainfrom
tlq5l:fix/task-config-unknown-field-2635
Open

tlq5l wants to merge 1 commit into
voidzero-dev:mainfrom
tlq5l:fix/task-config-unknown-field-2635

Conversation

@tlq5l

@tlq5l tlq5l commented Oct 6, 2026

Copy link
Copy Markdown

Refs voidzero-dev/vite-plus#2635

Motivation

A mistyped setting in a task, such as cache: { outputs: ["dist/**"] } (the field is output), fails with an error that names neither the key nor what is accepted:

* data did not match any variant of untagged enum UserTaskDefinition

UserTaskDefinition and UserCacheConfig were #[serde(untagged)], which discards each variant's own error. They now pick the variant from the value's type, so the real error comes through:

* unknown field `outputs`, expected one of `env`, `untrackedEnv`, `input`, `output`, `remote`

Valid configs parse as before and run-config.ts is unchanged. The error still doesn't name the task; that needs path tracking in the config loaders.

The main report in the issue (a cache hit that doesn't restore files) is already fixed by #461.

AI-assisted with Claude Opus 5.5.

A mistyped task setting such as `cache: { outputs: [...] }` failed with
"data did not match any variant of untagged enum UserTaskDefinition".
Deserialize `UserTaskDefinition` and `UserCacheConfig` by value type so
the error of the form the user wrote is shown instead.

Refs voidzero-dev/vite-plus#2635

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant