mirror of
https://github.com/RooVetGit/Roo-Code.git
synced 2026-09-07 08:26:51 +00:00
fix: add navigator shim for Node.js 22+ compatibility
This commit is contained in:
parent
6d8fa39319
commit
815bcb2e22
1 changed files with 24 additions and 0 deletions
|
|
@ -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 = globalThis.navigator || navigatorStub;
|
||||
globalThis._navigatorShimApplied = true;
|
||||
}
|
||||
`
|
||||
|
||||
/**
|
||||
* @type {import('esbuild').BuildOptions}
|
||||
*/
|
||||
|
|
@ -28,6 +49,9 @@ async function main() {
|
|||
format: "cjs",
|
||||
sourcesContent: false,
|
||||
platform: "node",
|
||||
banner: {
|
||||
js: navigatorShimBanner,
|
||||
},
|
||||
}
|
||||
|
||||
const srcDir = __dirname
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue