Kong/insomnia · error

Branch does not exist with name

Error message

Branch does not exist with name ${branchName}

What it means

_assertBranch is a guard helper: _getBranch returned null for the requested branch name, so a Branch handle could not be guaranteed.

Solutions

  1. Create or fetch the branch before referencing it
  2. Check the branch name spelling and case
  3. Pull the project to restore missing branches
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at packages/insomnia-vcs/src/vcs.ts:1472 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/e77b4fe61eab6741. Report an issue: GitHub.

Appendix: source

Thrown at packages/insomnia-vcs/src/vcs.ts:1472

    if (!id) {
      throw new Error('Not logged in');
    }

    return {
      accountId,
      sessionId: id,
      privateKey,
      publicKey,
      symmetricKey,
    };
  }

  async _assertBranch(branchName: string) {
    const branch = await this._getBranch(branchName);

    if (branch === null) {
      throw new Error(`Branch does not exist with name ${branchName}`);
    }

    return branch;
  }

  _backendProjectId() {
    if (this._backendProject === null) {
      throw new Error('No active backend project');
    }

    return this._backendProject.id;
  }

  async _getBranch(name: string): Promise<Branch | null> {
    return this._store.getItem(`/projects/${this._backendProjectId()}/branches/${encodeBranchName(name)}.json`);
  }

  async _getBranches(backendProjectId?: string) {

View on GitHub (pinned to d9bb2b0142)