Open kristofzerbe opened 3 months ago
IMHO it is not common to add 11 listeners on one event. 10
looks like a sane default setting to me and I don't see any reason to increase that in Hexo.
Ok ... therefore the use of hexo.on("ready") and other events is limited in Hexo to 10, if you want to avoid those warnings. Correct? If yes, this limitation should be documented under hexo.io API
Ok ... therefore the use of hexo.on("ready") and other events is limited in Hexo to 10, if you want to avoid those warnings. Correct? If yes, this limitation should be documented under hexo.io API
This limitation comes from Node.js, not from Hexo.
You are right. It is a Node topic, but Hexo runs under node and has to deal with it. Maybe it could be an option to introduce a config item for this?
You are right. It is a Node topic, but Hexo runs under node and has to deal with it.
As I said, it is very rare to add 11 listeners on one event. In fact, in the 12 years of Hexo's history, you are the first one to see this warning.
And since you already have access to setMaxListeners
, so why an extra option anyway?
Check List
Feature Request
I make heavy use of hexo.on("ready") and got now following NodeJS warning:
(node:16804) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 ready listeners added to [Hexo]. MaxListeners is 10. Use emitter.setMaxListeners() to increase limit
I set manually
this.setMaxListeners(100);
in constructor of hexo/index.js of Hexo class to avoid the problem, but it would be better to extend this in code base.Others
No response