-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Closed
Labels
Description
I'm following the "Basic Example" from the README:
import { createClient } from 'redis';
(async () => {
const client = createClient();
client.on('error', (err) => console.log('Redis Client Error', err));
await client.connect();
await client.set('key', 'value');
const value = await client.get('key');
})();
This results in the following TypeScript error:
Property 'on' does not exist on type 'RedisClientType<{ graph: { CONFIG_GET: typeof import("..."); configGet: typeof import("..."); ... 15 more ...; slowLog: typeof import("...'.ts(2339)
The property is there:
console.log((client as any).on); // logs: [Function: addListener]
It just appears to not be included in the type.
Environment:
- Node.js Version: v14.17.5
- Redis Server Version: 6.2.6
- Node Redis Version: redis@4.0.6
- Platform: Windows 11 22000.556 + WSL Ubuntu 20.04