You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The RedisClientType type appears to be missing the on method. This causes a type-checking error when using .on to handle events. Below is an example that triggers the error:
import{createClient}from"redis";constredis=createClient().on("error",(err)=>{});// ~~ Property 'on' does not exist on type 'RedisClientType...
I was surprised to see typing errors with on and once methods in both mongoose and redis. Downgrading to TS 5.4.5 was a one way to solve the issue, but are you perhaps using discord.js (or other packages depending on it)? They were using module augmentation to change EventEmitter typings, which caused issues after TS 5.5 release. See this. It's been fixed for a while now, and after upgrading the package, typings are working fine with the latest TS installed.
Description
The RedisClientType type appears to be missing the on method. This causes a type-checking error when using
.on
to handle events. Below is an example that triggers the error:Node.js Version
v22.9.0
Redis Server Version
not relevant
Node Redis Version
[email protected]
Platform
not relevant
Logs
No response
The text was updated successfully, but these errors were encountered: