1

During the maintenance process, of a NodeJS backend application, I updated the connect-redis package to the last version 6.1.3 and bumped in the following error

Error: A client must be directly provided to the RedisStore

I tried to check online but I didn't understand what change I needed to make in my code to make it work

import redisStore from 'connect-redis';
import session from 'express-session';
import config from '../config/conf';

const RedisStore = redisStore(session);
const sessionStore = new RedisStore({ url: process.env.SESSION_REDIS_URL });
const sessionConfig = {
  name: 'os.sid',
  store: sessionStore,
  saveUninitialized: false,
  resave: false,
  secret: config.sessionSecret,
  secure: config.isProduction,
  cookie: {
    path: '/',
    httpOnly: true,
    secure: config.isProduction,
    maxAge: null,
  },
};

I tried to read this but I cannot figure out what to change in my code with the imports

connec-redis post about the issue

Jakub
  • 2,367
  • 6
  • 31
  • 82

0 Answers0