Skip to content

Conversation

@ryuapp
Copy link
Contributor

@ryuapp ryuapp commented Nov 18, 2025

In Node.js, navigator is added from v21, so this will cause an error in Node.js v20.x.
This change allows the code to run on Node.js versions newer than Node.js v20.16.0, which added process.getBuiltinModule.

@ryuapp ryuapp requested a review from kt3k as a code owner November 18, 2025 17:57
@github-actions github-actions bot added the fs label Nov 18, 2025
@codecov
Copy link

codecov bot commented Nov 18, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.11%. Comparing base (e8e47da) to head (9c2b303).
⚠️ Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #6873      +/-   ##
==========================================
- Coverage   94.11%   94.11%   -0.01%     
==========================================
  Files         581      581              
  Lines       42698    42699       +1     
  Branches     6791     6791              
==========================================
  Hits        40185    40185              
- Misses       2462     2463       +1     
  Partials       51       51              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 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.

fs/_utils.ts Outdated
* True if the runtime is Deno, false otherwise.
*/
export const isDeno = navigator.userAgent?.includes("Deno");
export const isDeno = (globalThis as any).navigator.userAgent?.includes("Deno");
Copy link
Member

Choose a reason for hiding this comment

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

Do we also need ? after navigator, if it's undefined in Node.js v20?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are right, we need that. fix 9c2b303

Copy link
Member

@kt3k kt3k left a comment

Choose a reason for hiding this comment

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

LGTM

@kt3k kt3k merged commit 798fd7b into denoland:main Nov 20, 2025
19 checks passed
@ryuapp ryuapp deleted the fix/unstable-fs-support-for-node-v20 branch November 20, 2025 02:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants