forge
forge copied to clipboard
Deprecation warning with VS Code extensions using Node.js v20+: "navigator is now a global in nodejs"
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 anavigatorobject that is unlike the browser one - Hardware concurrency in
lib/util.js-> Technically valid