I tried using @types/socket.io-redis like so:
import { Server as HttpServer } from 'http';
import socketIo, { Socket } from 'socket.io';
import redis, { RedisAdapter } from 'socket.io-redis';
export default function setupWebsocket(server: HttpServer) {
const io = socketIo().listen(server);
io.adapter(redis(process.env.REDIS_URL));
const adapter: RedisAdapter = io.of('/').adapter; // Error here
}
At the section where the Error here comment is, I got a red underline at the adapter variable with the error:
Type 'Adapter' is not assignable to type 'RedisAdapter'.
Property 'uid' is missing in type 'Adapter'.
Can anyone help me fix this issue? I'm quite new to Typescript