-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
ESM Mode breaks when using openai package #12237
Comments
I have a feeling that all these wildcard imports/exports does not play well |
@danilofuchs thank you so much for the minimal reproduction! I don't get the same error but it's similar enough:
My best guess at the moment is that this is a bug in import { APIResource } from "../resource.mjs";
import { isRequestOptions } from "../core.mjs";
import * as BatchesAPI from "./batches.mjs";
import { CursorPage } from "../pagination.mjs";
export class Batches extends APIResource {
/** snip implementation */
}
export class BatchesPage extends CursorPage {
}
(function (Batches) {
Batches.BatchesPage = BatchesAPI.BatchesPage;
})(Batches || (Batches = {})); If I remove every circular Batches.BatchesPage = BatchesPage; I'll see if I can fix this in |
Here is the |
I opened another PR for There is patch available here that combines all the outstanding open PRs. |
@timfish the latest patch fixes it for me! |
Hello, we've just released v8.8.0, which should hopefully resolve this ESM problem. Let us know if you updated and are still running into problems! |
resolves #12242 (although there are still some follow ups) https://github.com/open-telemetry/opentelemetry-js/releases/tag/v1.25.0 I think this lockfile looks correct, but lmk if this feels off. resolves #12011 resolves #12059 resolves #12154 resolves #12237 resolves nodejs/import-in-the-middle#77 cc @mohd-akram
Is there an existing issue for this?
How do you use Sentry?
Sentry Saas (sentry.io)
Which SDK are you using?
@sentry/browser
SDK Version
8.4.0
"openai": "^4.33.1"
Framework Version
Node 8.4.0
Link to Sentry event
No response
SDK Setup
Steps to Reproduce
https://github.com/danilofuchs/sentry-esm-openai-repro
openai
packageinstrumentation.js
filenode --import ./build/instrumentation.js build/server.js
Expected Result
Runs with Sentry instrumentation.
Perhaps related to #12059 and #12154 (import-in-the-middle bugs)
Actual Result
files.mjs:51:41:
Obs:
Setting
globalThis._sentryEsmLoaderHookRegistered = true;
beforeSentry.init
fixes the crash but disables auto instrumentationThe text was updated successfully, but these errors were encountered: