node-redis icon indicating copy to clipboard operation
node-redis copied to clipboard

RedisStore error returns not valid RedisClient

Open Alexis90 opened this issue 2 years ago • 1 comments

Description

const redis = require("redis");
const { setup, RedisStore } = require("axios-cache-adapter");
const client = redis.createClient({
    url: 'REDIS_URL'
})
const store = new RedisStore(client) // => TypeError: First parameter must be a valid RedisClient instance.
    at new RedisStore (D:\dev\axios-cache\node_modules\axios-cache-adapter\dist\cache.node.js:5432:30)

So I trace back to redis.createClient function, when I do client.isReady => false, while client.isOpen => true

However I tried client.set(key,value), it successfully wrote into my Redis database.

My question is to understand why RedisStore function from axios-cache-adapter doesn't take my redis client and why when I check client.isReady it shows false.

Node.js Version

18

Redis Server Version

No response

Node Redis Version

4

Platform

No response

Logs

No response

Alexis90 avatar Mar 07 '23 14:03 Alexis90

i have same error in my side

mhsfh avatar Aug 10 '23 12:08 mhsfh