continuedev/continue · error · Error
Failed to parse config: ${formatZodError(e)}
Error message
Failed to parse config: ${formatZodError(e)} What it means
parseConfigYaml rethrows Zod validation failures with a human-formatted message (formatZodError) instead of raw Zod issues. The YAML parsed fine but did not match the config schema.
Source
Thrown at packages/config-yaml/src/load/unroll.ts:51
try {
const parsed = YAML.parse(configYaml);
const result = configYamlSchema.safeParse(parsed);
if (result.success) {
return result.data;
}
throw new Error(formatZodError(result.error), {
cause: "result.success was false",
});
} catch (e) {
if (
e instanceof Error &&
"cause" in e &&
e.cause === "result.success was false"
) {
throw new Error(`Failed to parse config: ${e.message}`);
} else if (e instanceof ZodError) {
throw new Error(`Failed to parse config: ${formatZodError(e)}`);
} else {
throw new Error(
`Failed to parse config: ${e instanceof Error ? e.message : e}`,
);
}
}
}
export function parseAssistantUnrolled(configYaml: string): AssistantUnrolled {
try {
const parsed = YAML.parse(configYaml);
const result = assistantUnrolledSchema.parse(parsed);
return result;
} catch (e: any) {
console.error(
`Failed to parse unrolled assistant: ${e.message}\n\n${configYaml}`,
);
throw new Error(`Failed to parse config: ${formatZodError(e)}`);View on GitHub (pinned to 5522c6f44c)
Solutions
- Read the formatted message: it lists the exact failing paths and expected types
- Fix the indicated fields in the YAML
- Compare against a known-good example config for the current schema version
Example fix
// before model: gpt-4 # wrong shape # after model: openai/gpt-4 # matches expected provider/model format
Defensive patterns
Strategy: validation
Validate before calling
// Dry-run schema validation for better UX
import { configSchema } from '...';
configSchema.safeParse(YAML.parse(configYaml)); // inspect issues before parseConfigYaml Try / catch
try {
parseConfigYaml(yaml);
} catch (e) {
if (e instanceof Error && e.message.startsWith('Failed to parse config:')) {
// show the formatted field paths to the user
}
} Prevention
- Maintain example configs per schema version
- Validate configs in CI with the schema
- Read the formatted path list carefully before editing
When it happens
Trigger: parseConfigYaml on YAML that is syntactically valid but has wrong field names, wrong types, missing required fields, or unknown enum values per the Zod schema.
Common situations: Typos in config keys, using an outdated config format after a library upgrade, wrong nesting of blocks/models.
Understand the failure class
Background: Schema validation failed / invalid input schema: payload rejected because its shape doesn't match the expected schema — this error's family across 28 libraries.
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
Related errors
- Failed to parse block: ${formatZodError(e)}
- FindAndReplaceMissingOldString
- FindAndReplaceMissingNewString
- Invalid agent file frontmatter: ${errorDetails}
- Table name must be in format schema.table_name, got ${tableN
AI-assisted analysis of continuedev/continue@5522c6f44c (2026-08-27).
Data as JSON: /api/errors/6f86a118a026599b.
Report an issue: GitHub.