Skip to content

Conversation

@TheDadi
Copy link

@TheDadi TheDadi commented May 5, 2025

Which problem is this PR solving?

  • The ESM imported top-level object is a Module Namespace Object per ECMA262 spec. The ".default" holds the equivalent of require('dataloader')

TypeError: Cannot read properties of undefined (reading 'load') at DataloaderInstrumentation._patchLoad

Contributes to #1942

@TheDadi TheDadi requested a review from a team as a code owner May 5, 2025 17:17
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented May 5, 2025

CLA Signed


The committers listed above are authorized under a signed CLA.

@codecov
Copy link

codecov bot commented May 7, 2025

Codecov Report

❌ Patch coverage is 92.30769% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 89.49%. Comparing base (a99ba69) to head (ffdf6c8).
⚠️ Report is 90 commits behind head on main.

Files with missing lines Patch % Lines
.../instrumentation-dataloader/src/instrumentation.ts 92.30% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2813      +/-   ##
==========================================
- Coverage   89.51%   89.49%   -0.02%     
==========================================
  Files         180      180              
  Lines        8735     8741       +6     
  Branches     1778     1780       +2     
==========================================
+ Hits         7819     7823       +4     
- Misses        916      918       +2     
Files with missing lines Coverage Δ
.../instrumentation-dataloader/src/instrumentation.ts 98.14% <92.30%> (-0.88%) ⬇️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@david-luna
Copy link
Contributor

Hi @TheDadi

Thanks for your contribution to OpenTelemetry. I think it would be good to add a test case for the ESM usage.

#2807 fixed ESM support for pg and included such test. You can take it as a reference

@dyladan
Copy link
Member

dyladan commented Jun 25, 2025

Related: #1942

This needs tests and fix the conflicts and we can get this merged

@david-luna
Copy link
Contributor

@TheDadi

This package was relocated in #2928. Please sync with the main branch and add the missing test so we can proceed to review again and merge the changes

Thank you

@pichlermarc
Copy link
Member

Closing due to inactivity - if anyone is interested in picking this up again, this is only missing tests for us to be able to merge this.

brianphillips added a commit to brianphillips/opentelemetry-js-contrib that referenced this pull request Aug 7, 2025
…dule

Code primarily comes from open-telemetry#2813. This commit adds a test
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants