Kong/insomnia · error · InsoError

Expected an Insomnia v4 export file; unexpected data found…

Error message

Expected an Insomnia v4 export file; unexpected data found in ${fileName}.

What it means

Thrown by the inso database adapter when a JSON export file parsed successfully but lacks the __export_format marker, meaning it is not recognizably an Insomnia v4/v5 export (and could not be converted by the v5 import path). The data is syntactically valid JSON but structurally foreign; fileName identifies the offending file.

Solutions

  1. Use a file produced by Insomnia's export feature
  2. If it is a v5 export, ensure the __export_format: 5 header is present
  3. Re-export from the app rather than constructing the file manually
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/insomnia-inso/src/db/adapters/insomnia-adapter.ts:111 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/632552f342c54992. Report an issue: GitHub.

Appendix: source

Thrown at packages/insomnia-inso/src/db/adapters/insomnia-adapter.ts:111

      const insomnia5Import = importInsomniaV5Data(content);

      if (insomnia5Import.length > 0) {
        parsed = {
          __export_format: 5,
          // @ts-expect-error -- TSCONVERSION
          resources: insomnia5Import,
        };
      }
    }
  } catch (error) {
    throw new InsoError(`Failed to parse ${fileName}.`, error);
  }

  // We are supporting only v4 and v5 files
  if (!parsed) {
    throw new InsoError(`Failed to parse ${fileName}.`);
  } else if (!parsed.__export_format) {
    throw new InsoError(`Expected an Insomnia v4 export file; unexpected data found in ${fileName}.`);
  } else if (parsed.__export_format !== 4 && parsed.__export_format !== 5) {
    throw new InsoError(
      `Expected an Insomnia v4 export file; found an Insomnia v${parsed.__export_format} export file in ${fileName}.`,
    );
  }

  // Transform filter to a set for faster search
  // If it is undefined, it will return an empty set
  const toFilter = new Set<string>(filterTypes);

  // Execute translation between raw and imported models
  parsed.resources.forEach(model => {
    // If there is no filter to apply, or this model is included in the filter
    if (!toFilter.size || toFilter.has(parseRawType(model._type))) {
      // Rename field, transform value and return a new object
      const obj = parseRaw(model);

      // Store it, only if the key value exists

View on GitHub (pinned to d9bb2b0142)