This repository was archived by the owner on May 15, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -17,6 +17,27 @@ async function main() {
1717 const minify = production
1818 const sourcemap = true // Always generate source maps for error handling.
1919
20+ // Navigator shim for Node.js 22+ compatibility (fixes PendingMigrationError in code-server)
21+ // See: https://github.com/RooCodeInc/Roo-Code/issues/10391
22+ const navigatorShimBanner = `// Navigator shim for Node.js 22+ compatibility
23+ if (typeof globalThis !== "undefined" && !globalThis._navigatorShimApplied) {
24+ const navigatorStub = {
25+ userAgent: "",
26+ platform: "",
27+ userLanguage: undefined,
28+ appName: "",
29+ appVersion: "",
30+ product: "",
31+ languages: [],
32+ hardwareConcurrency: 1,
33+ standalone: false,
34+ onLine: true,
35+ };
36+ globalThis.navigator = globalThis.navigator || navigatorStub;
37+ globalThis._navigatorShimApplied = true;
38+ }
39+ `
40+
2041 /**
2142 * @type {import('esbuild').BuildOptions }
2243 */
@@ -28,6 +49,9 @@ async function main() {
2849 format : "cjs" ,
2950 sourcesContent : false ,
3051 platform : "node" ,
52+ banner : {
53+ js : navigatorShimBanner ,
54+ } ,
3155 }
3256
3357 const srcDir = __dirname
You can’t perform that action at this time.
0 commit comments