You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When adding over 11 content scripts the following error is displayed:
(node:38511) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGTERM listeners added to [process]. MaxListeners is 10. Use emitter.setMaxListeners() to increase limit
I've noticed this as well, seems like each entrypoint group (build step) adds a listener... I assume because vite is adding it? Not 100% sure which dependency is causing it, but vite is my best guess.
Specifically when importing multiple entrypoints to extract their options during the build process, like content script matches, we use vite-node to import the TS file and do some preprocessing to speed things up.
However, for every imported entrypoint, we have to create a Vite dev server, and that's where the warning comes from, the dev server setting up a listener to close the server when stopping the process.
Fix is simple, only create a single dev server when importing entrypoint files, but refactoring the code to support that won't be... An easier fix is to import the files one by one, not in parallel, or setup a queue that only allows 9 imports be running at a time.
But I'd rather refactor and get this done right. For now, you can ignore this warning. It shouldn't be causing any problems.
Describe the bug
When adding over 11 content scripts the following error is displayed:
Reproduction
memory-setup.zip
Steps to reproduce
Run
yarn install
andyarn dev
System Info
Used Package Manager
yarn
Validations
The text was updated successfully, but these errors were encountered: