Kong/insomnia · error · Error

selected export format

Error message

selected export format "${selectedFormat}" is invalid

What it means

Guard in exportProjectToFile: the UI's selected export format does not map to a known exporter, so getInsomniaV5DataExport (or the format dispatch around it) cannot produce data for that format identifier and the export is aborted.

Solutions

  1. Pick one of the supported export formats offered in the export dialog (e.g. Insomnia v5)
  2. If triggered programmatically, pass a valid format identifier
  3. Update the app if the desired format is missing from the format list
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/insomnia/src/ui/components/settings/import-export.tsx:211 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/708334dce8f44875. Report an issue: GitHub.

Appendix: source

Thrown at packages/insomnia/src/ui/components/settings/import-export.tsx:211

            const insomniaProjectExportFolder = window.path.join(
              dirPath,
              `insomnia-export.${projectName}.${Date.now()}`,
            );

            for (const workspace of workspacesForActiveProject) {
              const workspaceName = workspace.name.replace(/ /g, '-');
              const fileName = window.path.join(insomniaProjectExportFolder, `${workspaceName}-${workspace._id}.yaml`);
              const stringifiedExport = await getInsomniaV5DataExport({
                workspaceId: workspace._id,
                includePrivateEnvironments: shouldExportPrivateEnvironments,
              });
              await writeExportedFileToFileSystem(fileName, stringifiedExport);
            }
            break;
          }

          default: {
            throw new Error(`selected export format "${selectedFormat}" is invalid`);
          }
        }
        window.main.trackAnalyticsEvent({ event: AnalyticsEvent.exportCompleted });
      } catch (err) {
        showError({
          title: 'Export Failed',
          error: err,
          message: 'Export failed due to an unexpected error',
        });
        return;
      }
    },
  });
};

export const exportMockServerToFile = async (workspace: Workspace) => {
  const fileName = await showSaveExportedFileDialog({
    exportedFileNamePrefix: workspace.name,

View on GitHub (pinned to d9bb2b0142)