Kong/insomnia · error · InsoError

Expected single or no ${entity} in the data store, but found

Error message

Expected single or no ${entity} in the data store, but found multiple (${items.length}).

What it means

Error "Expected single or no ${entity} in the data store, but found multiple (${items.length})." thrown in Kong/insomnia.

Source

Thrown at packages/insomnia-inso/src/db/models/util.ts:40

    hint?: string;
  } = {},
) => ({
  name: idIsh,
  message: indent(config.indent || 0, message),
  value: `${message} - ${idIsh}`,
  hint: config.hint || `${idIsh}`,
});

export const ensureSingleOrNone = <T>(items: T[], entity: string): T | null | undefined => {
  if (items.length === 1) {
    return items[0];
  }

  if (items.length === 0) {
    return null;
  }

  throw new InsoError(`Expected single or no ${entity} in the data store, but found multiple (${items.length}).`);
};
export const ensureSingle = <T>(items: T[], entity: string): T => {
  if (items.length === 1) {
    return items[0];
  }

  if (items.length === 0) {
    throw new InsoError(`Expected single ${entity} in the data store, but found none.`);
  }

  throw new InsoError(`Expected single ${entity} in the data store, but found multiple (${items.length}).`);
};

View on GitHub (pinned to d9bb2b0142)

When it happens

Trigger: Thrown at packages/insomnia-inso/src/db/models/util.ts:40 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/a4c929131d62190c. Report an issue: GitHub.