Fission-AI/OpenSpec · error · SchemaLoadError

Failed to parse schema at

Error message

Failed to parse schema at '${schemaPath}': ${parseError.message}

What it means

The schema file was read but parseSchema failed with an error that is not a SchemaValidationError — typically malformed YAML from the YAML parser itself. The parse error is wrapped in a SchemaLoadError with the schema path and original error as cause.

Solutions

  1. Check the schema YAML for syntax errors such as bad indentation, unclosed quotes, or stray tabs
  2. Run the file through a YAML linter to pinpoint the parse location
  3. Fix the reported line/column and retry resolution
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at src/core/artifact-graph/resolver.ts:220 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of Fission-AI/OpenSpec@6926ccb18a (2026-08-25). Data as JSON: /api/errors/649e95b939692b6c. Report an issue: GitHub.

Appendix: source

Thrown at src/core/artifact-graph/resolver.ts:220

    throw new SchemaLoadError(
      `Failed to read schema at '${schemaPath}': ${ioError.message}`,
      schemaPath,
      ioError
    );
  }

  try {
    return parseSchema(content);
  } catch (err) {
    if (err instanceof SchemaValidationError) {
      throw new SchemaLoadError(
        `Invalid schema at '${schemaPath}': ${err.message}`,
        schemaPath,
        err
      );
    }
    const parseError = err instanceof Error ? err : new Error(String(err));
    throw new SchemaLoadError(
      `Failed to parse schema at '${schemaPath}': ${parseError.message}`,
      schemaPath,
      parseError
    );
  }
}

/**
 * Lists all available schema names.
 * Combines project-local, user override, and package built-in schemas.
 *
 * @param projectRoot - Optional project root directory for project-local schema resolution
 */
export function listSchemas(projectRoot?: string): string[] {
  const schemas = new Set<string>();

  // Add package built-in schemas
  const packageDir = getPackageSchemasDir();

View on GitHub (pinned to 6926ccb18a)