Code Monkey home page Code Monkey logo

Comments (6)

wavded avatar wavded commented on August 23, 2024 1

I am removing the legacyMode requirement in the next major version of this package. If you want to try it you can npm install connect-redis@next in your projects:

Migration guide in this PR: #377

from connect-redis.

wavded avatar wavded commented on August 23, 2024 1

v7.0.0 has been released, closing

from connect-redis.

wavded avatar wavded commented on August 23, 2024

I am running 7 currently without issues. Did you run into anything?

from connect-redis.

djaffer avatar djaffer commented on August 23, 2024

You have to turn on legacy mode. It is a pain if you are using redis with the latest syntax.

Try this to get around

   const redisClient = redis.createClient();
    redisClient.on('connect', function () {
      console.log('Redis client connected');
    });
    const redisLegacy = redisClient.duplicate({ legacyMode: true });

    redisLegacy.on('connect', function () {
      console.log('Redis legacy client connected');
    });
   const sessionStore = new RedisStore({ client: redisLegacy})

from connect-redis.

rafipiccolo avatar rafipiccolo commented on August 23, 2024

I wanted to update the readme but the solution was already in it.

// redis@v4
const { createClient } = require("redis")
let redisClient = createClient({ legacyMode: true })
redisClient.connect().catch(console.error)

you can close this ticket i guess.

from connect-redis.

danwhitston avatar danwhitston commented on August 23, 2024

I'd swing in favour of keeping this ticket open, or replacing it with one to update from legacy mode. Redis v5 was released in 2018, and this is the recommended module for Redis session auth in the Redis docs. Judging by Stack Overflow, the legacy mode requirement is tripping people up regularly, and there are only going to be more problems as v4 syntax recedes into the past.

from connect-redis.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.