Is there an existing issue for this?
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
https://trainwell.sentry.io/issues/5463070600/?project=6067364&query=is%3Aunresolved+issue.priority%3A%5Bhigh%2C+medium%5D&referrer=issue-stream&statsPeriod=14d&stream_index=1
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/openai@4.49.0/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.
Is there an existing issue for this?
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
https://trainwell.sentry.io/issues/5463070600/?project=6067364&query=is%3Aunresolved+issue.priority%3A%5Bhigh%2C+medium%5D&referrer=issue-stream&statsPeriod=14d&stream_index=1
SDK Setup
Steps to Reproduce
openaipackageThe addition of the following code is what triggers the issue:
Expected Result
App builds with sentry instrumentation and no errors.
Actual Result
I receive the following error:
This might be related to #12237 however it appears to be a unique issue unrelated to initialization.