Closed
Description
Description
When using RedisJSON commands, getting error: "Receiver must be an instance of class RedisCluster". Simple operations like get or set work fine.
RedisJSON module is enabled on my Redis cluster. Commands work fine on Go services using go-redis.
Redis is instantied as such:
this.redisCluster = createCluster({
rootNodes: [
{
url: `redis://${configService.get<string>('REDIS_HOST')}:${configService.get<string>('REDIS_PORT')}`,
},
],
defaults: {
socket: {
connectTimeout: 15000, // 15 seconds
keepAlive: true, // Keep-alive every 5 seconds
reconnectStrategy: (retries) => {
const delay = Math.min(retries * 100, 3000); // Max 3 second delay between retries
console.warn(
`Redis connection retry attempt: ${retries}, retrying in ${delay}ms`,
);
return delay;
},
},
},
});
Node.js Version
20
Redis Server Version
7.4.2
Node Redis Version
5.0.1
Platform
Linux and macOS
Logs
TypeError: Receiver must be an instance of class RedisCluster
2025-05-20T12:26:35.981+03:00 at Object.get (/home/node/node_modules/.pnpm/@[email protected]/node_modules/@redis/client/dist/lib/cluster/index.js:29:31)