-
Notifications
You must be signed in to change notification settings - Fork 771
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 and Regular Expression Denial of Service #349
Comments
Thanks for the report, we're looking into upgrading. |
We can't upgrade to node-fetch 3.x because it's ESM-only, and this library supports CJS as well. We're looking into backporting the fix for that issue to the 2.x line. FWIW, I don't believe the memory leak effects should be very significant, so this warning should be safe to ignore. |
In the meantime, @marck283 you can work around this by installing import nodeFetch from 'node-fetch'
import OpenAI from 'openai'
const client = new OpenAI({ fetch: nodeFetch }) |
We don't expect to action this directly, so closing. We are planning to remove our |
Confirm this is a Node library issue and not an underlying OpenAI API issue
Describe the bug
Using Node.js version 20.x or later in a project that depends on node-fetch prior to version 3.2.5 results in Node prompting a MaxListenersExceededWarning: Possible EventEmitter memory leak detected warning (as can be seen here). However, node-fetch versions between 3.1.0 and 3.2.10 also suffer from a Regular Expression Denial of Service (as can be seen here). Installing [email protected] seems to solve both problems.
To Reproduce
Code snippets
No response
OS
Windows 11
Node version
Node v20.7.0
Library version
openai v4.11.1
The text was updated successfully, but these errors were encountered: