Deprecation warning with VS Code extensions using Node.js v20+: "navigator is now a global in nodejs"

Đang mở
#1,122 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
45/100
Loại issue
Lỗi
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Đình trệ
Công nghệ
javascript, node.js
Lĩnh vực
security

Hướng nghiên cứu

Start by reading the navigator checks in lib/jsbn.js, lib/random.js, and lib/util.js, then compare their behavior under the affected Node.js versions and VS Code 1.101+. Confirm which checks are browser-specific versus valid for Node.js. Done means the deprecation warning is eliminated without breaking browser detection, entropy collection, or hardware-concurrency handling.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

Warning in VS Code 1.101+:

2025-11-02 01:39:50.792 [warning] [Deprecation Warning] 'PendingMigrationError' is deprecated. navigator is now a global in nodejs, please see https://aka.ms/vscode-extensions/navigator for additional info on this error.
 FROM: PendingMigrationError: navigator is now a global in nodejs, please see https://aka.ms/vscode-extensions/navigator for additional info on this error.

Root Cause

Node.js v21+ introduced navigator as a global object (https://nodejs.org/en/blog/release/v21.2.0). The library contains checks like:

if (typeof navigator !== 'undefined') {
  // browser-specific code
}

It seems the following 3 places violate this rule:

  • Browser detection logic in lib/jsbn.js -> Faulty Node.JS check
  • Entropy collection in lib/random.js -> Might be faulty since some Node.JS versions have a navigator object that is unlike the browser one
  • Hardware concurrency in lib/util.js -> Technically valid
Ngôn ngữ chính
JavaScript
Star
5.4k
Fork
874
Merge trung bình
3 phút
Pull request đã merge (30 ngày)
6

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của digitalbazaar/forge

Tất cả issue của digitalbazaar/forge

Issue tương tự

Thêm issue về JavaScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.