fix(browser-detector): ensure Node.js v21+ is not detected as browser#6271
Conversation
|
|
|
This makes more sense . I'll update the logic to use feature detection for window and document and verify that the Node.js regression test still passes. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #6271 +/- ##
==========================================
+ Coverage 95.41% 95.45% +0.04%
==========================================
Files 317 317
Lines 9597 9597
Branches 2220 2221 +1
==========================================
+ Hits 9157 9161 +4
+ Misses 440 436 -4
🚀 New features to boost your workflow:
|
|
@fiyinfoluwa001 While testing, I didn't realize I could push to your branch. 🤷 My mistake. I created a helper function (used elsewhere in OTel) called |
Removing my review because I unintentionally added code.
|
Thank you for the help with describeNode and the environment check refactor! I’ve pulled the changes locally. I appreciate the guidance on following the project's testing standards. |
|
Thank you for your contribution @fiyinfoluwa001! 🎉 We would like to hear from you about your experience contributing to OpenTelemetry by taking a few minutes to fill out this survey. |
Fixes #6244 Description: > Modern Node.js and Bun runtimes now define a global navigator object. This caused the BrowserDetector to incorrectly identify these environments as browsers. Changes:
Updated isBrowser check to explicitly verify that process.versions.node and Bun.version are undefined.
Added a regression test case in BrowserDetector.test.ts that runs in Node.js to verify an empty resource is returned even when navigator is present.