Skip to content

fix(node): Fix exports for openai instrumentation #17238

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

Conversation

RulaKhaled
Copy link
Member

Fixed an issue where default exports in CommonJS were failing. Returning a new exports object was overriding some default export functionality. I removed some redundant code as well.

Copy link

linear bot commented Jul 31, 2025

@RulaKhaled RulaKhaled marked this pull request as ready for review July 31, 2025 08:46
Copy link
Member

@chargome chargome left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we test this somehow?

@RulaKhaled
Copy link
Member Author

Should we test this somehow?

I tested this with different scenarios locally, and it should work fine. I don't think adding a test for the exports is necessary here, since it should behave as expected—OpenAI just happens to export both a default and a named constant for the same constructor 😅

@RulaKhaled RulaKhaled merged commit 8ed15bb into develop Jul 31, 2025
134 checks passed
@RulaKhaled RulaKhaled deleted the rolaabuhasna/js-791-sentrynode-v940-breaks-openai-imports-when-tracessampler-is branch July 31, 2025 09:24
RulaKhaled added a commit that referenced this pull request Jul 31, 2025
Fixed an issue where default exports in CommonJS were failing. Returning
a new exports object was overriding some default export functionality. I
removed some redundant code as well.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants