tj / connect-redis

Redis session store for Connect

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The expected type comes from property 'client' which is declared here on type 'RedisStoreOptions'.

moeteztounsi opened this issue · comments

Hi there,
So for the past 2 weeks I was trying to use connect-redis in it's latest version.
I followed the installation process and the API guide provided in the readme file.
This is an example of what I did:
`import redis from 'redis';
import session from 'express-session';
import connectRedis from 'connect-redis';
const app = express();

const RedisStore = connectRedis(session);
const redisClient = redis.createClient({ legacyMode: true});
redisClient.connect().catch(console.error);
app.use(
    session({
        store: new RedisStore({client:redisClient}),
        saveUninitialized: false,
        secret: "keyboard cat",
        resave: false,
    },),`

The problem is when passing client:redisClient into new RedisStore I am getting this error:The expected type comes from property 'client' which is declared here on type 'RedisStoreOptions' while compiling typescript to javascript.
And I am getting a TypeError: Cannot read properties of undefined(reading 'createClient') when running the compiled js file.

We don't maintain any Typescript types in this package, it is maintained by a 3rd party in the @types library. You will to report the issue there.