Kong/insomnia · error
"extends" target must be a .yaml or .yml file: ${absolute}
Error message
"extends" target must be a .yaml or .yml file: ${absolute} What it means
Error ""extends" target must be a .yaml or .yml file: ${absolute}" thrown in Kong/insomnia.
Source
Thrown at packages/insomnia/src/main/bundle-spectral-ruleset.ts:35
// "extends" is treated as opaque data and passed through unchanged.
type Ruleset = Record<string, unknown> & {
extends?: string[];
};
// Safety checks for local-file extends entries:
// - Depth / cycle guard against infinite recursion.
// - Extension check ensures we only load YAML files.
// - rootDir guard prevents path traversal (e.g. '../../../etc/passwd') from
// reaching files outside the directory of the originally-selected ruleset.
function assertAllowed(absolute: string, visited: Set<string>, depth: number, rootDir: string): void {
if (depth > MAX_EXTENDS_DEPTH) {
throw new Error(`"extends" nested too deeply (max ${MAX_EXTENDS_DEPTH}) at ${absolute}`);
}
if (visited.has(absolute)) {
throw new Error(`"extends" cycle detected at ${absolute}`);
}
if (!ALLOWED_EXTENSIONS.includes(path.extname(absolute).toLowerCase())) {
throw new Error(`"extends" target must be a .yaml or .yml file: ${absolute}`);
}
const rel = path.relative(rootDir, absolute);
if (rel.startsWith('..') || path.isAbsolute(rel)) {
throw new Error(`"extends" target must stay within the ruleset's root directory: ${absolute}`);
}
}
// Reads a local ruleset file from disk and parses it.
async function readRuleset(absolute: string): Promise<Ruleset> {
const raw = await fs.promises.readFile(absolute, { encoding: 'utf8' });
const parsed = YAML.parse(raw);
if (parsed === null || typeof parsed !== 'object' || Array.isArray(parsed)) {
throw new Error(`Ruleset at ${absolute} must be an object at the top level.`);
}
return parsed as Ruleset;
}
function isPlainObject(value: unknown): value is Record<string, unknown> {View on GitHub (pinned to d9bb2b0142)
When it happens
Trigger: Thrown at packages/insomnia/src/main/bundle-spectral-ruleset.ts:35 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of Kong/insomnia@d9bb2b0142 (2026-08-26).
Data as JSON: /api/errors/3b8d867a4131d462.
Report an issue: GitHub.