Kong/insomnia · error · Error

Failed to decode base64

Error message

Failed to decode base64

What it means

Error "Failed to decode base64" thrown in Kong/insomnia.

Source

Thrown at packages/insomnia/src/ui/auth-session-provider.client.ts:40

  } catch {
    console.error('Failed to store secret key in localStorage.');
  }
});
/**
 * Keypair used for the login handshake.
 * This keypair can be re-used for the entire session.
 */

export async function decodeBase64(base64: string): Promise<Uint8Array> {
  try {
    let uri = 'data:application/octet-binary;base64,';
    uri += base64;
    const res = await fetch(uri);
    const buffer = await res.arrayBuffer();
    return new Uint8Array(buffer);
  } catch (error) {
    console.error(error);
    throw new Error('Failed to decode base64');
  }
}

export async function encodeBase64(data: Uint8Array): Promise<string> {
  const dataUri = await new Promise<string>((resolve, reject) => {
    const reader = new FileReader();
    reader.onload = () => {
      if (typeof reader.result === 'string') {
        resolve(reader.result);
      } else {
        reject();
      }
    };
    reader.onerror = reject;
    reader.readAsDataURL(new Blob([data]));
  });

  const dataAt = dataUri.indexOf(',');

View on GitHub (pinned to d9bb2b0142)

When it happens

Trigger: Thrown at packages/insomnia/src/ui/auth-session-provider.client.ts:40 when the library encounters an invalid state.

Common situations: See trigger scenarios.

Understand the failure class


AI-assisted analysis of Kong/insomnia@d9bb2b0142 (2026-08-26). Data as JSON: /api/errors/5fc53633bbc545c8. Report an issue: GitHub.