diegosouzapw/OmniRoute · error · Error

Redis driver requires ioredis package. Run npm install iored

Error message

Redis driver requires ioredis package. Run npm install ioredis.

What it means

Error "Redis driver requires ioredis package. Run npm install ioredis." thrown in diegosouzapw/OmniRoute.

Source

Thrown at src/lib/quota/redisQuotaStore.ts:59

  quit(): Promise<string>;
}

/**
 * Return the singleton Redis client. Throws if ioredis is not installed.
 * The url parameter is only used when creating the connection for the first time.
 */
export async function getRedisClient(url: string): Promise<RedisLike> {
  if (_redisClient) {
    return _redisClient as RedisLike;
  }

  // Lazy dynamic require — ioredis is an optional dependency
  let Redis: new (url: string) => RedisLike;
  try {
    const mod = await import("ioredis");
    Redis = (mod.default ?? mod) as new (url: string) => RedisLike;
  } catch {
    throw new Error("Redis driver requires ioredis package. Run npm install ioredis.");
  }

  _redisClient = new Redis(url);
  return _redisClient as RedisLike;
}

/** Test-only: reset the Redis singleton. */
export function resetRedisClient(): void {
  _redisClient = null;
}

// ---------------------------------------------------------------------------
// Key helpers
// ---------------------------------------------------------------------------

const KEY_PREFIX = `${process.env.REDIS_KEY_PREFIX?.trim() || "omniroute:"}quota`;

function bucketKey(apiKeyId: string, dimensionKey: string, bucketIndex: number): string {

View on GitHub (pinned to a179ffed5b)

When it happens

Trigger: Thrown at src/lib/quota/redisQuotaStore.ts:59 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of diegosouzapw/OmniRoute@a179ffed5b (2026-08-25). Data as JSON: /api/errors/9638ec9ffd204f58. Report an issue: GitHub.