-
Notifications
You must be signed in to change notification settings - Fork 10.1k
Closed
Labels
to triageWaiting to be triaged by a member of the teamWaiting to be triaged by a member of the team
Description
Describe the bug
In the How to use with express-session part of the docs, there's an example for 4.6.0+ version of the library, that suggests to use express middleware with io.engine.use, but typings seem to be off. io.engine.use accepts Middleware type, but express-session middleware type is RequestHandler. Both are middleware handlers but the request types diverge. It leads to this issue:

To Reproduce
Socket.IO server version: 4.6.0
Server
import session from "express-session";
const sessionMiddleware = session({
secret: "changeit",
resave: false,
saveUninitialized: false
});
io.engine.use(sessionMiddleware);Expected behavior
No TS errors. Types are compatible
Platform:
- Device: MacBook
- OS: MacOS
carlBgood
Metadata
Metadata
Assignees
Labels
to triageWaiting to be triaged by a member of the teamWaiting to be triaged by a member of the team