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
Confirm this is a Node library issue and not an underlying OpenAI API issue
This is an issue with the Node library
Describe the bug
Calling new OpenAI() fails when Sentry is preloaded.
❯ node --import @sentry/node/preload ./dist/index.js
TypeError: API.Completions is not a constructor
at new OpenAI (file:///home/nato/Code/github.com/NatoBoram/bug-report-sentry/node_modules/.pnpm/[email protected]/node_modules/openai/index.mjs:46:28)
at file:///home/nato/Code/github.com/NatoBoram/bug-report-sentry/dist/openai.js:3:23
at ModuleJob.run (node:internal/modules/esm/module_job:262:25)
at async ModuleLoader.import (node:internal/modules/esm/loader:474:24)
at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:109:5)
(node:394397) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
Hi @NatoBoram
Looks like there is a fix being worked on over in the getsentry/sentry-javascript#12414 issue discussion.
Let me know if there's anything I can do to help from my end beyond what is being worked on with nodejs/import-in-the-middle#103, otherwise I'll check back in on this once that change lands.
Confirm this is a Node library issue and not an underlying OpenAI API issue
Describe the bug
Calling
new OpenAI()
fails when Sentry is preloaded.To Reproduce
new OpenAI()
Code snippets
This is the code that fails:
It fails when the project is started with
node --import @sentry/node/preload
.OS
Pop!_OS 22.04 LTS x86_64
Node version
v22.3.0
Library version
^4.51.0
The text was updated successfully, but these errors were encountered: