I am working on a project that entails putting two different marketo forms on the same page. This is resulting in the following console error:
(node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.
The console trace points to marketo's form2 js file. I have even tried removing every event listener on my end just to be sure.
Anyone have any ideas?
Thanks.
Solved! Go to Solution.
You have to link to your code.
The error is pretty accurate: a userland event management library (EventEmitter, developed I think originally by Joyent) is used by Forms2. Unlike native browser events, EE tries to be aware of when a stack limit is reached, sometimes creating unnecessary worry.
You have to link to your code.
The error is pretty accurate: a userland event management library (EventEmitter, developed I think originally by Joyent) is used by Forms2. Unlike native browser events, EE tries to be aware of when a stack limit is reached, sometimes creating unnecessary worry.
Turned out there were too many calls to MktoForms2.whenReady().
Right, you can almost always combine those event listeners (just seek the form ID in the listener).