Skip to content
This repository has been archived by the owner on Jul 8, 2023. It is now read-only.

MaxListenersExceededWarning: Possible EventEmitter memory leak detected. #59

Open
alexbartisro opened this issue May 3, 2020 · 0 comments

Comments

@alexbartisro
Copy link

I have this method. It should iterate through all open pages and find a specific one by title.

function pauseXteamRadio(callback) {
    (async () => {
        try {
            const browser = await foxr.connect(options)
            const pages = await browser.pages()

            for (page of pages) {
                const title = await page.title()

                console.log(title)
            }
            
            browser.disconnect()
            callback()

            console.log('paused playing X-Team Radio')
        } catch (error) {
            console.error(error)
        }
    })()
}

The issue is at const title = await page.title() where it throws the error

(node:37464) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 disconnected listeners added to [Browser]. Use emitter.setMaxListeners() to increase limit
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant