Skip to content

Type 'ListenEvents' does not satisfy the constraint 'EventsMap'. node_modules/socket.io/dist/namespace.d.ts #4459

@marc-wittwer

Description

@marc-wittwer

Describe the bug
I get the following error when I run npm run build in my node.js express application.

 npm run build

> [email protected] build
> tsc -p .

node_modules/socket.io/dist/namespace.d.ts:14:133 - error TS2344: Type 'ListenEvents' does not satisfy the constraint 'EventsMap'.

14 export interface ServerReservedEventsMap<ListenEvents, EmitEvents, ServerSideEvents, SocketData> extends NamespaceReservedEventsMap<ListenEvents, EmitEvents, ServerSideEvents, SocketData> {
                                                                                                                                       ~~~~~~~~~~~~

  node_modules/socket.io/dist/namespace.d.ts:14:42
    14 export interface ServerReservedEventsMap<ListenEvents, EmitEvents, ServerSideEvents, SocketData> extends NamespaceReservedEventsMap<ListenEvents, EmitEvents, ServerSideEvents, SocketData> {
                                                ~~~~~~~~~~~~
    This type parameter might need an `extends EventsMap` constraint.

node_modules/socket.io/dist/namespace.d.ts:15:42 - error TS2344: Type 'ListenEvents' does not satisfy the constraint 'EventsMap'.

15     new_namespace: (namespace: Namespace<ListenEvents, EmitEvents, ServerSideEvents, SocketData>) => void;
                                            ~~~~~~~~~~~~

  node_modules/socket.io/dist/namespace.d.ts:14:42
    14 export interface ServerReservedEventsMap<ListenEvents, EmitEvents, ServerSideEvents, SocketData> extends NamespaceReservedEventsMap<ListenEvents, EmitEvents, ServerSideEvents, SocketData> {
                                                ~~~~~~~~~~~~
    This type parameter might need an `extends EventsMap` constraint.


Found 2 errors in the same file, starting at: node_modules/socket.io/dist/namespace.d.ts:14

My system:
Node v17.9.1 (npm v8.11.0)
Ubuntu 20.04
socket.io: "^4.5.1",

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions