{"record":{"id":"f92b7be068d1ad3e","repo":"Fission-AI/OpenSpec","slug":"openspec-config-yaml-is-not-a-valid-yaml-object","errorCode":null,"errorMessage":"openspec/config.yaml is not a valid YAML object","messagePattern":"openspec/config\\.yaml is not a valid YAML object","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/core/project-config.ts","lineNumber":278,"sourceCode":" * adding ~1-3ms total overhead. Caching would add complexity (mtime checks,\n * invalidation logic) for negligible benefit. Direct reads also ensure config\n * changes are reflected immediately without stale cache issues.\n *\n * @param projectRoot - The root directory of the project (where `openspec/` lives)\n * @returns Parsed config or null if file doesn't exist\n */\nexport function readProjectConfig(projectRoot: string): ProjectConfig | null {\n  const configPath = resolveConfigFilePath(projectRoot);\n  if (configPath === null) {\n    return null; // No config is OK\n  }\n\n  try {\n    const content = readFileSync(configPath, 'utf-8');\n    const raw = parseYaml(content);\n\n    if (!raw || typeof raw !== 'object') {\n      console.warn(`openspec/config.yaml is not a valid YAML object`);\n      return null;\n    }\n\n    const config: Partial<ProjectConfig> = {};\n\n    // Parse schema field using Zod\n    const schemaField = z.string().min(1);\n    const schemaResult = schemaField.safeParse(raw.schema);\n    if (schemaResult.success) {\n      config.schema = schemaResult.data;\n    } else if (raw.schema !== undefined) {\n      console.warn(`Invalid 'schema' field in config (must be non-empty string)`);\n    }\n\n    // Parse context field with size limit\n    if (raw.context !== undefined) {\n      const contextField = z.string();\n      const contextResult = contextField.safeParse(raw.context);","sourceCodeStart":260,"sourceCodeEnd":296,"githubUrl":"https://github.com/Fission-AI/OpenSpec/blob/6926ccb18afa4ff621112813e9968334576ee11a/src/core/project-config.ts#L260-L296","documentation":"Error \"openspec/config.yaml is not a valid YAML object\" thrown in Fission-AI/OpenSpec.","triggerScenarios":"Thrown at src/core/project-config.ts:278 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"6926ccb18afa4ff621112813e9968334576ee11a","analyzedAt":"2026-08-25T12:29:45.729Z","schemaVersion":2},"datasetVersion":"2026-08-25T16:17:27.014Z"}