-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MaxListenersExceededWarning: Possible EventEmitter memory leak detected #7
Comments
That seems weird, I'll take a look! What version of Eleventy and eleventy-critical-css are you using? Do you have a repository I can clone to investigate further? |
Same here with eleventy 1.0.0-beta.8. The build breaks with the error "FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory" |
I have a repo you can test - https://github.com/atlas-bi/website I've always gotten this message and just ignored it probably started with 11ty v0.10.0 and still get it in 1.0.0. |
Hey @gregives did you have a chance to check this out? |
Hi @christopherpickering sorry I haven't taken a look yet, I might have some time tomorrow to investigate. As the code for eleventy-critical-css is only 20 lines long, I imagine the problem actually lies the |
Hmm, yeah, you're right. I wonder if because 11ty is processing the pages async that penthouse gets overloaded? |
I think that's right, critical or penthouse seems to register more and more listeners without checking |
I've taken a look at this and I don't think the error is coming from eleventy-critical-css but from critical, probably related to this issue. I will open another issue in the critical repository, to see if they can investigate it further. If you want the warning to go away, you can either increase the limit or turn the limit off, like so: process.setMaxListeners(100); // Increase the limit
process.setMaxListeners(0); // Turn off the limit However, be aware of what you are doing before you include those lines of code. There is a StackOverflow thread here with some useful context. |
As a follow up @gregives would you be so kind to link the issue # from critical here, once you've opened it please? |
Reopening this issue as it's still a problem and hasn't been solved upstream in critical, I'll be releasing a fix for this soon! |
This has been fixed in v2.0.2, let me know if you have any problems with it! |
Since i enabled critical-css i see this in my build.
node:26304) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 exit listeners added to [process]. Use emitter.setMaxListeners() to increase limit
(Use
node --trace-warnings ...
to show where the warning was created)(node:26304) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGTERM listeners added to [process]. Use emitter.setMaxListeners() to increase limit
(node:26304) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 SIGINT listeners added to [process]. Use emitter.setMaxListeners() to increase limit
The text was updated successfully, but these errors were encountered: