request / request-promise-native

The simplified HTTP request client 'request' with Promise support. Powered by native ES6 promises.
ISC License
1.1k stars 63 forks source link

(node:2180) MaxListenersExceededWarning: Possible EventEmitter memory leak detected #28

Closed przemyslawpluta closed 5 years ago

przemyslawpluta commented 6 years ago

Getting (node:2180) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 pipe listeners added. Use emitter.setMaxListeners() to increase limit in node v8 and v10 and rp1.0.5

(node:2180) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 pipe listeners added. Use emitter.setMaxListeners() to increase limit
    at _addListener (events.js:243:17)
    at Request.addListener (events.js:259:10)
    at Request.init (/e3v/node_modules/request/request.js:493:8)
    at Request.RP$initInterceptor [as init] (/e3v/node_modules/request-promise-core/configure/request2.js:45:29)
    at Redirect.onResponse (/e3v/node_modules/request/lib/redirect.js:149:11)
    at Request.onRequestResponse (/e3v/node_modules/request/request.js:993:22)
    at ClientRequest.emit (events.js:182:13)
    at ClientRequest.EventEmitter.emit (domain.js:442:20)
    at HTTPParser.parserOnIncomingClient (_http_client.js:538:21)
    at HTTPParser.parserOnHeadersComplete (_http_common.js:109:17)
analog-nico commented 5 years ago

This is actually an error that comes up if you add more and more features to your project and doesn’t necessarily have something to do with this library. Have a look here for more information on it. If you really have a memory leak then I’d assume that the number will count up over time.