Kong/insomnia · error · InsoError

Failed to write to "${outputPath}"

Error message

Failed to write to "${outputPath}"

What it means

Error "Failed to write to "${outputPath}"" thrown in Kong/insomnia.

Source

Thrown at packages/insomnia-inso/src/commands/export-specification.ts:15

import { mkdir, writeFile } from 'node:fs/promises';
import path from 'node:path';

import YAML from 'yaml';

import { InsoError } from '../errors';

export async function writeFileWithCliOptions(outputPath: string, contents: string): Promise<string> {
  try {
    await mkdir(path.dirname(outputPath), { recursive: true });
    await writeFile(outputPath, contents);
    return outputPath;
  } catch (error) {
    console.error(error);
    throw new InsoError(`Failed to write to "${outputPath}"`, error);
  }
}

export async function exportSpecification({
  specContent,
  skipAnnotations,
}: {
  specContent: string;
  skipAnnotations: boolean;
}) {
  if (!skipAnnotations) {
    return specContent;
  }

  const recursiveDeleteKey = (obj: any) => {
    Object.keys(obj).forEach(key => {
      if (key.startsWith('x-kong-')) {
        delete obj[key];

View on GitHub (pinned to d9bb2b0142)

When it happens

Trigger: Thrown at packages/insomnia-inso/src/commands/export-specification.ts:15 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/20b32fea4cf34a77. Report an issue: GitHub.