Closed andresgutgon closed 10 years ago
Each Translate component will add an event listener for Counterpart's localechange event. If you are using more than 10 components on a page, Node will show the warning you described. There is no memory leak or whatsoever.
I will set the maximum allowed listeners of Counterpart's event emitter to unlimited. This should fix your problem. I will get back to you when this is resolved.
I've tagged a new release (v0.4.2) which should resolve this. Please try it out and re-open this issue if necessary.
Yes! That solved my problem. Thanks.
There is no memory leak or whatsoever.
Can you explain why that is not a problem and we ignore the warning? Thanks again
Can you explain why that is not a problem and we ignore the warning?
Node.js thinks that 10+ listeners for a single event seems odd and so outputs a warning. But in our case (there usually are more than 10 Translate components on a web page which register an event listener) we just tell Node.js to shut up and go on.
http://nodejs.org/api/events.html#events_emitter_setmaxlisteners_n
Thanks @martinandert
Hi, first of all thank you for this component. I appreciate your work.
I'm trying it and it works. but I'm getting this in Chrome console.
In the image you can read this message:
It´s a warning. But is anoying :(
What i'm doing
I've moved all my Ì18n` to a file this way:
And then I use this way:
Not a solution
If I remove some of the translations I generate less than 10 event binding and the warning disappear. But that is not a real solution :)