-
Notifications
You must be signed in to change notification settings - Fork 371
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
Calling critical.generate
lots of times in parallel seems to cause MaxListenersExceededWarning
#528
Comments
I have created a simpler repository to reproduce this issue: https://github.com/gregives/critical-issue-528-reproduction |
Thanks @gregives. I'll take a look if this has anything todo with critical. @pocketjoso what do you think? Have you ever encountered this warning in penthouse? |
hey @gregives, It should also be possible to implement this directly in your plugin. I hacked around a bit inside Looks like this does the trick already |
Hey @bezoerb, thank you so much for looking into this, no need to apologise for the late reply! I've just taken a look at the Critical codebase and I think it might be possible to implement without a list of all URLs, would you be open to a pull request? I'll give it a go and if not, I'll make a change to my plugin. Thank you for your Gist, that's really helpful! |
Hey @gregives |
Hey @bezoerb, I hope you're well! I finally got around to fixing this warning in eleventy-critical-css, here's my commit that fixes it: I believe the fix could be applied to critical itself without much work, by doing something similar to the I don't have much spare time at the moment, but if I get a minute then I'll raise a PR for it! |
I am the author of the eleventy-critical-css Eleventy plugin which calls
critical.generate
for every HTML file outputted by Eleventy. An issue was filed on eleventy-critical-css saying that the plugin was causing a MaxListenersExceededWarning.When the plugin is used with larger Eleventy sites,
critical.generate
is called lots of times in parallel and it causes a MaxListenersExceededWarning. Here is the stack trace:This repository was added to the issue on eleventy-critical-css which successfully reproduces the problem.
If I have time, I will create a simpler reproduction, probably just by callingSee new simpler repository below.critical.generate
lots of times in parallel.I am unsure if this is a problem with Critical or with Penthouse, let me know if you want me to raise an issue in the Penthouse repository instead. Thanks for your help!
The text was updated successfully, but these errors were encountered: