possible EventEmitter memory leak
I'm seeing a lot of: (node) warning: possible EventEmitter memory leak detected. 11 end listeners added. Use emitter.setMaxListeners() to increase limit.. Is this a real concern?
Thanks for reporting! I will have a look at this as soon as possible (although I cannot promise when).
I'm unable to reproduce this. uCSS only creates two event emitters itself. But I see that Request has several issues mentioning EventEmitter memory leaks.
I've tried updating to the newest version of Request, hoping that it fixes the problem. Could you please check if the problem persists?
If this still is a problem, it may be because of a redirect loop. Setting maxRedirects in the options when doing request.get (lib/css.js and lib/html.js) may help. I would be grateful if you could try this, or provide me with the config you use so that I can reproduce and investigate further. Thanks!
Did you, by any chance, get the warning when running tests?
@oyvindeh I was getting the error when using ucss on a large complex site, I am still seeing these warnings, possibly in conjunction with timeouts
Timeout: http://localhost:3000/support/faq
(node) warning: possible EventEmitter memory leak detected. 11 end listeners added. Use emitter.setMaxListeners() to increase limit.
Trace
at Request.addListener (events.js:239:17)
at Request.start (/usr/local/lib/node_modules/ucss/node_modules/request/request.js:807:8)
at Request.end (/usr/local/lib/node_modules/ucss/node_modules/request/request.js:1418:10)
at end (/usr/local/lib/node_modules/ucss/node_modules/request/request.js:580:14)
at Immediate._onImmediate (/usr/local/lib/node_modules/ucss/node_modules/request/request.js:594:7)
at processImmediate [as _immediateCallback] (timers.js:383:17)
(node) warning: possible EventEmitter memory leak detected. 11 end listeners added. Use emitter.setMaxListeners() to increase limit.
Trace
at Request.addListener (events.js:239:17)
at Request.start (/usr/local/lib/node_modules/ucss/node_modules/request/request.js:807:8)
at Request.end (/usr/local/lib/node_modules/ucss/node_modules/request/request.js:1418:10)
at end (/usr/local/lib/node_modules/ucss/node_modules/request/request.js:580:14)
at Immediate._onImmediate (/usr/local/lib/node_modules/ucss/node_modules/request/request.js:594:7)
at processImmediate [as _immediateCallback] (timers.js:383:17)
Yup I can confirm this. I think this might be shown in new version of Node.