Skip to content

connect-redis no longer compatible with @fastify/session #224

@ctkc

Description

@ctkc

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the bug has not already been reported

Fastify version

4.24.3

Plugin version

10.6.0

Node.js version

18.17.0

Operating system

macOS

Operating system version (i.e. 20.04, 11.3, 10)

14.0

Description

Trying to make this plugin work with the latest version of connect-redis will fail since express-session is a peer dependency of it since version 7.0.0. RedisStore is extending Store from express-session and also using the SessionData type from it as you can see here: https://github.com/tj/connect-redis/blob/master/index.ts

This leads to the following issue when trying to run a project without express-session installed:

Error: Cannot find module 'express-session'

This can be fixed by downgrading the connect-redis version to v6.1.3

Steps to Reproduce

  1. Set up a project with Fastify, @fastify/session and connect-redis
  2. Run the project
  3. You should get the error message mentioned above

Expected Behavior

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions