grunt-contrib-watch
grunt-contrib-watch copied to clipboard
emitter.setMaxListeners()
Just thought I'd drop this here since it took me FOREVER to figure this out.
If you're getting these errors:
warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.
just set the maxListeners
option in your watch config to something large. Like this:
watch: {
options: {
maxListeners: 99,
...
}
}
Hope this helps.
Thanks, @drgould! @shama, what do you think about processing this warning in the task to tell people to set maxListeners
instead of emitter.setMaxListeners()
?
Sounds good to me.
if (process.setMaxListeners) { process.setMaxListeners(10000); }
was searching for this as Smeagol was searching for his precious.
https://stackoverflow.com/a/31443386