Skip to content

(node:87) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 unhandledRejection listeners added to [process]. Use emitter.setMaxListeners() to increase limit #3040

Closed as not planned
@siddjain

Description

@siddjain
  • Node.js Version:

node -v
v12.18.1

  • OS:

uname -a
Linux b8d5107fc64e 3.10.0-1062.9.1.el7.x86_64 #1 SMP Mon Dec 2 08:31:54 EST 2019 x86_64 Linux

(using node:12-alpine Docker image)

I have following code:

process.on('unhandledRejection', (reason, promise) => {
  logger.error(`Unhandled Rejection at: ${promise} reason: ${reason}`);        
});

and it is triggering following warning:

(node:87) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 unhandledRejection listeners added to [process]. Use emitter.setMaxListeners() to increase limit

The code is not inside any for loop. I am executing it only once. It seems like a bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions