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

Aperta
#1,122 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
javascript, node.js
Ambito
security

Direzione di ricerca

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.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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
Lingua principale
JavaScript
Stelle
5.4k
Fork
874
Merge medio
3m
PR unite (30g)
6

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di digitalbazaar/forge

Tutte le issue di digitalbazaar/forge

Issue simili

Altre issue su JavaScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.