Fission-AI/OpenSpec · error · TemplateLoadError
error instanceof Error ? error.message : String(error)
Error message
error instanceof Error ? error.message : String(error)
What it means
Error "error instanceof Error ? error.message : String(error)" thrown in Fission-AI/OpenSpec.
Source
Thrown at src/core/artifact-graph/instruction-loader.ts:226
schemaName: string,
templatePath: string,
projectRoot?: string
): string {
const schemaDir = getSchemaDir(schemaName, projectRoot);
if (!schemaDir) {
throw new TemplateLoadError(
`Schema '${schemaName}' not found`,
templatePath
);
}
const templatesDir = path.join(schemaDir, 'templates');
const templatePathOnDisk = path.join(templatesDir, templatePath);
try {
FileSystemUtils.assertPathWithin(templatesDir, templatePathOnDisk);
} catch (error) {
throw new TemplateLoadError(
error instanceof Error ? error.message : String(error),
templatePathOnDisk
);
}
if (!fs.existsSync(templatePathOnDisk)) {
throw new TemplateLoadError(
`Template not found: ${templatePathOnDisk}`,
templatePathOnDisk
);
}
const fullPath = FileSystemUtils.canonicalizeExistingPath(templatePathOnDisk);
try {
return fs.readFileSync(fullPath, 'utf-8');
} catch (err) {
const ioError = err instanceof Error ? err : new Error(String(err));View on GitHub (pinned to 6926ccb18a)
When it happens
Trigger: Thrown at src/core/artifact-graph/instruction-loader.ts:226 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of Fission-AI/OpenSpec@6926ccb18a (2026-08-25).
Data as JSON: /api/errors/eb26ff016ddf95d5.
Report an issue: GitHub.