this.server.adapter(...) is not a constructor #4320
Answered
by
dragonlobster
dragonlobster
asked this question in
Q&A
-
Hi, I'm trying to use socket.io with typescript but i think there is something i'm misconfiguring in my tsconfig. when i try to adapt a redis server, i get the following error:
i adapted the redis server by doing this: import { createClient } from "redis";
const client = createClient({url: "redis://localhost:6379"})
const subClient = client.duplicate()
io.adapter(client, subClient) my tsconfig.json looks like this, surely there's something wrong with it as i'm a beginner with typescript "compilerOptions": {
"target": "ESNext",
"module": "CommonJS",
"lib": ["ESNext", "DOM", "scripthost"],
"moduleResolution": "Node",
"strict": true,
"sourceMap": true,
"resolveJsonModule": true,
"esModuleInterop": true,
"types": [],
"noEmit": true,
"noUnusedLocals": true,
"noUnusedParameters": true,
"noImplicitReturns": true
} thank you i appreciate any help or feedback |
Beta Was this translation helpful? Give feedback.
Answered by
dragonlobster
Mar 21, 2022
Replies: 1 comment
-
sorry, i think i just forgot import { createAdapter } from "@socket.io/redis-adapter"
io.adapter(client, subClient) |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
dragonlobster
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
sorry, i think i just forgot
createAdapter()
function