Skip to content
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions src/esbuild.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,27 @@ async function main() {
const minify = production
const sourcemap = true // Always generate source maps for error handling.

// Navigator shim for Node.js 22+ compatibility (fixes PendingMigrationError in code-server)
// See: https://github.com/RooCodeInc/Roo-Code/issues/10391
const navigatorShimBanner = `// Navigator shim for Node.js 22+ compatibility
if (typeof globalThis !== "undefined" && !globalThis._navigatorShimApplied) {
const navigatorStub = {
userAgent: "",
platform: "",
userLanguage: undefined,
appName: "",
appVersion: "",
product: "",
languages: [],
hardwareConcurrency: 1,
standalone: false,
onLine: true,
};
globalThis.navigator = navigatorStub;
globalThis._navigatorShimApplied = true;
}
`

/**
* @type {import('esbuild').BuildOptions}
*/
Expand All @@ -28,6 +49,9 @@ async function main() {
format: "cjs",
sourcesContent: false,
platform: "node",
banner: {
js: navigatorShimBanner,
},
}

const srcDir = __dirname
Expand Down
Loading