{"record":{"id":"9638ec9ffd204f58","repo":"diegosouzapw/OmniRoute","slug":"redis-driver-requires-ioredis-package-run-npm-ins","errorCode":null,"errorMessage":"Redis driver requires ioredis package. Run npm install ioredis.","messagePattern":"Redis driver requires ioredis package\\. Run npm install ioredis\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/lib/quota/redisQuotaStore.ts","lineNumber":59,"sourceCode":"  quit(): Promise<string>;\n}\n\n/**\n * Return the singleton Redis client. Throws if ioredis is not installed.\n * The url parameter is only used when creating the connection for the first time.\n */\nexport async function getRedisClient(url: string): Promise<RedisLike> {\n  if (_redisClient) {\n    return _redisClient as RedisLike;\n  }\n\n  // Lazy dynamic require — ioredis is an optional dependency\n  let Redis: new (url: string) => RedisLike;\n  try {\n    const mod = await import(\"ioredis\");\n    Redis = (mod.default ?? mod) as new (url: string) => RedisLike;\n  } catch {\n    throw new Error(\"Redis driver requires ioredis package. Run npm install ioredis.\");\n  }\n\n  _redisClient = new Redis(url);\n  return _redisClient as RedisLike;\n}\n\n/** Test-only: reset the Redis singleton. */\nexport function resetRedisClient(): void {\n  _redisClient = null;\n}\n\n// ---------------------------------------------------------------------------\n// Key helpers\n// ---------------------------------------------------------------------------\n\nconst KEY_PREFIX = `${process.env.REDIS_KEY_PREFIX?.trim() || \"omniroute:\"}quota`;\n\nfunction bucketKey(apiKeyId: string, dimensionKey: string, bucketIndex: number): string {","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/diegosouzapw/OmniRoute/blob/a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d/src/lib/quota/redisQuotaStore.ts#L41-L77","documentation":"Error \"Redis driver requires ioredis package. Run npm install ioredis.\" thrown in diegosouzapw/OmniRoute.","triggerScenarios":"Thrown at src/lib/quota/redisQuotaStore.ts:59 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a179ffed5bb2e0b883b9ae7214ce8717b2a94c4d","analyzedAt":"2026-08-25T18:35:09.898Z","schemaVersion":2},"datasetVersion":"2026-08-25T21:54:21.419Z"}