-
Notifications
You must be signed in to change notification settings - Fork 10.1k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Describe the bug
After upgrading to socket.io 4.0.0, my code no longer compiles when using string enums for event names.
To Reproduce
Please fill the following code example:
Socket.IO server version: 4.0.0
[email protected]
Server
import { Server } from "socket.io";
const io = new Server(3000, {});
// this works fine
io.on("connection", (socket) => {});
enum Event {
CONNECTION = "connection",
}
// Fails to compile!
// Argument of type '(socket:Socket) => void' is not assignable to parameter of type 'never'.
// ts(2345)
io.on(Event.CONNECTION, (socket) => {});
Client
N/A
Expected behavior
I expect my code to compile like it does for version 2.x and 3.x.
Platform:
N/A
seth-gravy and westy92
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working