-
Notifications
You must be signed in to change notification settings - Fork 1.1k
OpenAI SDK Warning: 'this' Undefined at Top Level of ES Module with Nuxt and Bun #1394
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
Open
1 task done
Labels
bug
Something isn't working
Comments
Thanks for the report, do you also see this warning using the |
The problem persists in bun and also in node 22.
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Confirm this is a Node library issue and not an underlying OpenAI API issue
Describe the bug
I’ve encountered the following warning in my project when using the OpenAI TypeScript SDK:
My project dependencies are:
I’m running the project with:
It seems to be related to how the OpenAI SDK is handling ES modules, possibly due to a compatibility issue with my setup. Has anyone experienced this warning, and how can I resolve it?"
To Reproduce
Steps to reproduce the behavior:
Expected Behavior: No warnings should appear in the console.
Actual Behavior: The following warning repeats dozens of times in the console:
WARN node_modules/openai/lib/AbstractChatCompletionRunner.mjs (1:30): The 'this' keyword is equivalent to 'undefined' at the top level of an ES module, and has been rewritten
Code snippets
OS
Windows WSL and Ubuntu Server
Node version
Node 22
Library version
Openai 4.87.4
The text was updated successfully, but these errors were encountered: