Closed
Description
Is there an existing issue for this?
- I have checked for existing issues https://github.com/getsentry/sentry-javascript/issues
- I have reviewed the documentation https://docs.sentry.io/
- I am using the latest SDK release https://github.com/getsentry/sentry-javascript/releases
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/node
SDK Version
8.8.0
Framework Version
Node 20.14.0
Link to Sentry event
SDK Setup
Sentry.init({
dsn: "[REDACTED]",
});
Steps to Reproduce
- Add
openai
package - Instrument using instrumentation.js file
- Run with node --import ./dist/instrumentation.js dist/index.js
The addition of the following code is what triggers the issue:
import OpenAI from "openai";
const openAI = new OpenAI({
apiKey: "[REDACTED]",
});
Expected Result
App builds with sentry instrumentation and no errors.
Actual Result
I receive the following error:
TypeError: API.Completions is not a constructor
at new OpenAI (file:///[REDACTED]/node_modules/.pnpm/[email protected]/node_modules/openai/index.mjs:46:28)
at file:///[REDACTED]
at ModuleJob.run (node:internal/modules/esm/module_job:222:25)
at async ModuleLoader.import (node:internal/modules/esm/loader:316:24)
at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:123:5)
This might be related to #12237 however it appears to be a unique issue unrelated to initialization.
Metadata
Metadata
Assignees
Type
Projects
Status
No status