possible EventEmitter memory leak detected
- December 18, 2019
- 1 reply
- 8770 views
I built a landing page (LP) template that can handle multiple languages as a single page (We currently use 9 languages). Instead of building 9 LPs, we build one LP and the content changes based on the URL parameter. The page also includes 9 form IDs for each language. It looks like the forms are causing a memory leak warning from Forms2.min.JS:
(node) warning: possible EventEmitter memory leak detected. 11 listeners added. Use emitter.setMaxListeners() to increase limit.
Even though not all forms are being rendered, it looks like Forms2.min.JS is emitting each form and our Google Tag Manager (GTM) is counting each mkto.form.rendered. I also added a 'remove();' function to my JS to remove the form sections, not in use from the DOM, so in the Web Dev tools, only the one form ID is shown, but I'm still seeing in my GTM (9) mkto.form.rendered events (See screenshots).
Has anyone else used multiple forms on a single page and has anyone tried to solve the 'memory leak detected' warning and/or had a similar GTM issue counting all forms on the page even if they don't show via the DOM?