{"record":{"id":"d7e283fc367bac5d","repo":"continuedev/continue","slug":"failed-to-parse-config-e-message","errorCode":null,"errorMessage":"Failed to parse config: ${e.message}","messagePattern":"Failed to parse config: (.+?)","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/config-yaml/src/load/unroll.ts","lineNumber":49,"sourceCode":"\nexport function parseConfigYaml(configYaml: string): ConfigYaml {\n  try {\n    const parsed = YAML.parse(configYaml);\n    const result = configYamlSchema.safeParse(parsed);\n    if (result.success) {\n      return result.data;\n    }\n\n    throw new Error(formatZodError(result.error), {\n      cause: \"result.success was false\",\n    });\n  } catch (e) {\n    if (\n      e instanceof Error &&\n      \"cause\" in e &&\n      e.cause === \"result.success was false\"\n    ) {\n      throw new Error(`Failed to parse config: ${e.message}`);\n    } else if (e instanceof ZodError) {\n      throw new Error(`Failed to parse config: ${formatZodError(e)}`);\n    } else {\n      throw new Error(\n        `Failed to parse config: ${e instanceof Error ? e.message : e}`,\n      );\n    }\n  }\n}\n\nexport function parseAssistantUnrolled(configYaml: string): AssistantUnrolled {\n  try {\n    const parsed = YAML.parse(configYaml);\n    const result = assistantUnrolledSchema.parse(parsed);\n    return result;\n  } catch (e: any) {\n    console.error(\n      `Failed to parse unrolled assistant: ${e.message}\\n\\n${configYaml}`,","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/continuedev/continue/blob/5522c6f44ca0ac3528b37244818fbfa39b5af470/packages/config-yaml/src/load/unroll.ts#L31-L67","documentation":"parseConfigYaml wraps YAML/parse failures: this branch fires when an error carries cause === 'result.success was false', i.e. the underlying parse pipeline reported failure and the original message is re-wrapped with the 'Failed to parse config' prefix.","triggerScenarios":"Calling parseConfigYaml with a YAML string that the underlying parser rejects with a success:false result object (internal pipeline failure rather than a Zod schema mismatch).","commonSituations":"Malformed YAML (tabs, bad indentation), an unroll step failing, or a version mismatch producing unexpected intermediate structures.","solutions":["Read e.message embedded in the wrapped error for the root cause","Validate the YAML syntactically (yamllint / YAML.parse alone) before calling parseConfigYaml","Check the config against the expected schema version for your package version"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Validate YAML syntax first\nYAML.parse(configYaml); // throws raw YAML errors with better context","typeGuard":null,"tryCatchPattern":"try {\n  parseConfigYaml(yaml);\n} catch (e) {\n  if (e instanceof Error && e.message.startsWith('Failed to parse config')) {\n    // surface e.message (contains the underlying cause)\n  }\n}","preventionTips":["Lint YAML files in CI","Keep schema/config versions in sync","Pre-validate with YAML.parse for clearer errors"],"tags":["yaml","config","parsing"],"backgroundTag":"yaml-parse-failed","analyzedSha":"5522c6f44ca0ac3528b37244818fbfa39b5af470","analyzedAt":"2026-08-27T11:28:54.683Z","schemaVersion":2},"datasetVersion":"2026-08-27T13:17:12.746Z"}