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
Run pnpm install, if deps are not already installed
Run pnpm tsx main.js
Expected Result
The OpenAI call should just work without issues.
Actual Result
Instead, we get a runtime error:
> pnpm tsx main.js
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
TypeError: Cannot read private member from an object whose class did not declare it
at Object.__classPrivateFieldGet (/project/workspace/node_modules/.pnpm/openai@5.10.2/node_modules/openai/internal/tslib.js:21:15)
at Proxy.buildURL (/project/workspace/node_modules/.pnpm/openai@5.10.2/node_modules/openai/src/client.ts:446:23)
at Proxy.buildRequest (/project/workspace/node_modules/.pnpm/openai@5.10.2/node_modules/openai/src/client.ts:818:22)
at Proxy.makeRequest (/project/workspace/node_modules/.pnpm/openai@5.10.2/node_modules/openai/src/client.ts:532:46)
Further context
@sentry/node version 9.39 works fine, versions 9.40 and 9.41 are both broken
Note that the OpenAI instrumentation isn't even enabled in the above repro example
It seems important that the OpenAI package is imported using require, not import. Also, it seems important that tsx is involved in running the project. There are probably also other ways to run into this problem, but I couldn't find any in this small repro environment.
It also seems relevant that the code is using the chat.completions.parse endpoint, instead of chat.completions.create.
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
9.41
Framework Version
No response
Link to Sentry event
No response
Reproduction Example/SDK Setup
https://codesandbox.io/p/devbox/hardcore-margulis-fsy833?file=%2Fpackage.json%3A13%2C23
Steps to Reproduce
pnpm install, if deps are not already installedpnpm tsx main.jsExpected Result
The OpenAI call should just work without issues.
Actual Result
Instead, we get a runtime error:
Further context
@sentry/nodeversion 9.39 works fine, versions 9.40 and 9.41 are both brokenopenaipackage itself: TypeError: Cannot read private member from an object whose class did not declare it at __classPrivateFieldGet openai/openai-node#1590require, notimport. Also, it seems important thattsxis involved in running the project. There are probably also other ways to run into this problem, but I couldn't find any in this small repro environment.chat.completions.parseendpoint, instead ofchat.completions.create.