2

i get that error in my console even though i have 'new' in my code

 const RedisStore=connectRedis(session)
    const client=redis.createClient()
    
     app.use(
        session(
            {
                name:"kid",
                store :new RedisStore(
                    {
                    disableTouch:true,
                    client:client,
                    })
                ,

idk what to try i cant find a sollution

1 Answer 1

1

Chances are good you're running v7+ of connect-redis. Whereas in the past you had to initialize express-session separately and pass it in:

const RedisStore=connectRedis(session)

you only need this instead:

const RedisStore = require("connect-redis").default;

and can remove express-session from the declaration, although you'll still need to define your session for express itself. See the end of this link in Github issues for further details on the new RedisStore call, and the code section of its Github in general for new boilerplate code.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.