From 2bb1697cadf5d1e4007fd48aafa86db6a1f4e647 Mon Sep 17 00:00:00 2001 From: Steven Molen Date: Mon, 23 Feb 2026 12:45:33 -0600 Subject: [PATCH 1/7] fix(nodejs): add CJS compatibility for VS Code extensions (#528) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace import.meta.resolve with createRequire + path walking in getBundledCliPath(). The new implementation falls back to __filename when import.meta.url is unavailable (shimmed CJS environments like VS Code extensions bundled with esbuild format:"cjs"). Single ESM build output retained — no dual CJS/ESM builds needed. The fallback logic handles both native ESM and shimmed CJS contexts. --- nodejs/src/client.ts | 30 ++++++++++++++---- nodejs/test/cjs-compat.test.ts | 58 ++++++++++++++++++++++++++++++++++ 2 files changed, 81 insertions(+), 7 deletions(-) create mode 100644 nodejs/test/cjs-compat.test.ts diff --git a/nodejs/src/client.ts b/nodejs/src/client.ts index b8e7b31dc..e70b18e63 100644 --- a/nodejs/src/client.ts +++ b/nodejs/src/client.ts @@ -14,9 +14,10 @@ import { spawn, type ChildProcess } from "node:child_process"; import { randomUUID } from "node:crypto"; import { existsSync } from "node:fs"; +import { createRequire } from "node:module"; import { Socket } from "node:net"; import { dirname, join } from "node:path"; -import { fileURLToPath } from "node:url"; +import { pathToFileURL } from "node:url"; import { createMessageConnection, MessageConnection, @@ -91,14 +92,29 @@ function getNodeExecPath(): string { /** * Gets the path to the bundled CLI from the @github/copilot package. * Uses index.js directly rather than npm-loader.js (which spawns the native binary). + * + * The @github/copilot package only exposes an ESM-only "./sdk" export, + * which breaks in CJS contexts (e.g., VS Code extensions bundled with esbuild). + * Instead of resolving through the package's exports, we locate the package + * root by walking module resolution paths and checking for its directory. + * See: https://github.com/github/copilot-sdk/issues/528 */ function getBundledCliPath(): string { - // Find the actual location of the @github/copilot package by resolving its sdk export - const sdkUrl = import.meta.resolve("@github/copilot/sdk"); - const sdkPath = fileURLToPath(sdkUrl); - // sdkPath is like .../node_modules/@github/copilot/sdk/index.js - // Go up two levels to get the package root, then append index.js - return join(dirname(dirname(sdkPath)), "index.js"); + // import.meta.url is defined in ESM; in CJS bundles (esbuild format:"cjs") + // it's undefined, so we fall back to __filename via pathToFileURL. + const require = createRequire(import.meta.url ?? pathToFileURL(__filename).href); + // The @github/copilot package has strict ESM-only exports, so require.resolve + // cannot resolve it. Instead, walk the module resolution paths to find it. + const searchPaths = require.resolve.paths("@github/copilot") ?? []; + for (const base of searchPaths) { + const candidate = join(base, "@github", "copilot", "index.js"); + if (existsSync(candidate)) { + return candidate; + } + } + throw new Error( + `Could not find @github/copilot package. Searched ${searchPaths.length} paths. Ensure it is installed.` + ); } /** diff --git a/nodejs/test/cjs-compat.test.ts b/nodejs/test/cjs-compat.test.ts new file mode 100644 index 000000000..e04fc400c --- /dev/null +++ b/nodejs/test/cjs-compat.test.ts @@ -0,0 +1,58 @@ +/** + * CJS shimmed environment compatibility test + * + * Verifies that getBundledCliPath() works when the ESM build is loaded in a + * shimmed CJS environment (e.g., VS Code extensions bundled with esbuild + * format:"cjs"). In these environments, import.meta.url may be undefined but + * __filename is available via the CJS shim. + * + * See: https://github.com/github/copilot-sdk/issues/528 + */ + +import { describe, expect, it } from "vitest"; +import { existsSync } from "node:fs"; +import { execFileSync } from "node:child_process"; +import { join } from "node:path"; + +const esmEntryPoint = join(import.meta.dirname, "../dist/index.js"); + +describe("CJS shimmed environment compatibility (#528)", () => { + it("ESM dist file should exist", () => { + expect(existsSync(esmEntryPoint)).toBe(true); + }); + + it("getBundledCliPath() should resolve in a CJS shimmed context", () => { + // Simulate what esbuild format:"cjs" does: __filename is defined, + // import.meta.url may be undefined. The SDK's fallback logic + // (import.meta.url ?? pathToFileURL(__filename).href) handles this. + // + // We test by requiring the ESM build via --input-type=module in a + // subprocess that has __filename available, verifying the constructor + // (which calls getBundledCliPath()) doesn't throw. + const script = ` + import { createRequire } from 'node:module'; + const require = createRequire(import.meta.url); + const sdk = await import(${JSON.stringify(esmEntryPoint)}); + if (typeof sdk.CopilotClient !== 'function') { + process.exit(1); + } + try { + const client = new sdk.CopilotClient({ cliUrl: "8080" }); + console.log('CopilotClient constructor: OK'); + } catch (e) { + console.error('constructor failed:', e.message); + process.exit(1); + } + `; + const output = execFileSync( + process.execPath, + ["--input-type=module", "--eval", script], + { + encoding: "utf-8", + timeout: 10000, + cwd: join(import.meta.dirname, ".."), + }, + ); + expect(output).toContain("CopilotClient constructor: OK"); + }); +}); From 86b6c8ac4cc395059862e9c37e708bb66d71dde3 Mon Sep 17 00:00:00 2001 From: Steven Molen Date: Wed, 11 Mar 2026 12:07:34 -0500 Subject: [PATCH 2/7] docs(nodejs): note CJS bundle and system-installed CLI requirements --- nodejs/README.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/nodejs/README.md b/nodejs/README.md index e9d23c529..d63f745d4 100644 --- a/nodejs/README.md +++ b/nodejs/README.md @@ -850,6 +850,21 @@ try { - Node.js >= 18.0.0 - GitHub Copilot CLI installed and in PATH (or provide custom `cliPath`) +### CJS Bundles (esbuild, VS Code extensions) + +The SDK is ESM-only. When loaded in a CJS-shimmed environment (e.g., a VS Code extension bundled with `esbuild format:"cjs"`), `getBundledCliPath()` resolves the CLI by walking `node_modules`. The `@github/copilot` package **must be present in `node_modules` at runtime** — do not externalize or exclude it from your bundle. + +### System-installed CLI (winget, brew, apt) + +If you installed the Copilot CLI separately rather than relying on the SDK's bundled copy, `getBundledCliPath()` will not find it (it only searches `node_modules`). Pass `cliPath` explicitly instead: + +```typescript +const client = new CopilotClient({ + cliPath: '/usr/local/bin/copilot', // macOS/Linux + // cliPath: 'C:\\path\\to\\copilot.exe', // Windows (winget, etc.) +}); +``` + ## License MIT From 5ebc06efe565631f2083ff64201baebd28a42cc4 Mon Sep 17 00:00:00 2001 From: Steve Sanderson Date: Thu, 19 Mar 2026 16:20:21 +0000 Subject: [PATCH 3/7] Dual ESM/CJS build for CommonJS compatibility (#528) Produce both ESM and CJS outputs from the esbuild config so that consumers using either module system get a working package automatically. - Add a second esbuild.build() call with format:"cjs" outputting to dist/cjs/ - Write a dist/cjs/package.json with type:"commonjs" so Node treats .js as CJS - Update package.json exports with "import" and "require" conditions for both the main and ./extension entry points - Revert getBundledCliPath() to use import.meta.resolve for ESM, with a createRequire + path-walking fallback for CJS contexts - Update CJS compatibility tests to verify the actual dual build - Update README to document CJS/CommonJS support Co-Authored-By: Copilot <223556219+Copilot@users.noreply.github.com> --- nodejs/README.md | 11 ++++-- nodejs/esbuild-copilotsdk-nodejs.ts | 17 +++++++++ nodejs/package.json | 22 +++++++++--- nodejs/src/client.ts | 32 ++++++++++------- nodejs/test/cjs-compat.test.ts | 53 +++++++++++++++++------------ 5 files changed, 93 insertions(+), 42 deletions(-) diff --git a/nodejs/README.md b/nodejs/README.md index d63f745d4..6a9059e20 100644 --- a/nodejs/README.md +++ b/nodejs/README.md @@ -850,13 +850,18 @@ try { - Node.js >= 18.0.0 - GitHub Copilot CLI installed and in PATH (or provide custom `cliPath`) -### CJS Bundles (esbuild, VS Code extensions) +### CJS / CommonJS Support -The SDK is ESM-only. When loaded in a CJS-shimmed environment (e.g., a VS Code extension bundled with `esbuild format:"cjs"`), `getBundledCliPath()` resolves the CLI by walking `node_modules`. The `@github/copilot` package **must be present in `node_modules` at runtime** — do not externalize or exclude it from your bundle. +The SDK ships both ESM and CJS builds. Node.js and bundlers (esbuild, webpack, etc.) automatically select the correct format via the `exports` field in `package.json`: + +- `import` / `from` → ESM (`dist/index.js`) +- `require()` → CJS (`dist/cjs/index.cjs`) + +This means the SDK works out of the box in CJS environments such as VS Code extensions bundled with `esbuild format:"cjs"`. ### System-installed CLI (winget, brew, apt) -If you installed the Copilot CLI separately rather than relying on the SDK's bundled copy, `getBundledCliPath()` will not find it (it only searches `node_modules`). Pass `cliPath` explicitly instead: +If you installed the Copilot CLI separately rather than relying on the SDK's bundled copy, pass `cliPath` explicitly: ```typescript const client = new CopilotClient({ diff --git a/nodejs/esbuild-copilotsdk-nodejs.ts b/nodejs/esbuild-copilotsdk-nodejs.ts index 059b8cfa6..0467bca7a 100644 --- a/nodejs/esbuild-copilotsdk-nodejs.ts +++ b/nodejs/esbuild-copilotsdk-nodejs.ts @@ -4,6 +4,7 @@ import { execSync } from "child_process"; const entryPoints = globSync("src/**/*.ts"); +// ESM build await esbuild.build({ entryPoints, outbase: "src", @@ -15,5 +16,21 @@ await esbuild.build({ outExtension: { ".js": ".js" }, }); +// CJS build — uses .js extension with a "type":"commonjs" package.json marker +await esbuild.build({ + entryPoints, + outbase: "src", + outdir: "dist/cjs", + format: "cjs", + platform: "node", + target: "es2022", + sourcemap: false, + outExtension: { ".js": ".js" }, +}); + +// Mark the CJS directory so Node treats .js files as CommonJS +import { writeFileSync } from "fs"; +writeFileSync("dist/cjs/package.json", JSON.stringify({ type: "commonjs" }) + "\n"); + // Generate .d.ts files execSync("tsc", { stdio: "inherit" }); diff --git a/nodejs/package.json b/nodejs/package.json index 214ef3466..6b0d30f2c 100644 --- a/nodejs/package.json +++ b/nodejs/package.json @@ -6,16 +6,28 @@ }, "version": "0.1.8", "description": "TypeScript SDK for programmatic control of GitHub Copilot CLI via JSON-RPC", - "main": "./dist/index.js", + "main": "./dist/cjs/index.js", "types": "./dist/index.d.ts", "exports": { ".": { - "import": "./dist/index.js", - "types": "./dist/index.d.ts" + "import": { + "types": "./dist/index.d.ts", + "default": "./dist/index.js" + }, + "require": { + "types": "./dist/index.d.ts", + "default": "./dist/cjs/index.js" + } }, "./extension": { - "import": "./dist/extension.js", - "types": "./dist/extension.d.ts" + "import": { + "types": "./dist/extension.d.ts", + "default": "./dist/extension.js" + }, + "require": { + "types": "./dist/extension.d.ts", + "default": "./dist/cjs/extension.js" + } } }, "type": "module", diff --git a/nodejs/src/client.ts b/nodejs/src/client.ts index e70b18e63..af466bf34 100644 --- a/nodejs/src/client.ts +++ b/nodejs/src/client.ts @@ -17,7 +17,7 @@ import { existsSync } from "node:fs"; import { createRequire } from "node:module"; import { Socket } from "node:net"; import { dirname, join } from "node:path"; -import { pathToFileURL } from "node:url"; +import { fileURLToPath } from "node:url"; import { createMessageConnection, MessageConnection, @@ -93,19 +93,24 @@ function getNodeExecPath(): string { * Gets the path to the bundled CLI from the @github/copilot package. * Uses index.js directly rather than npm-loader.js (which spawns the native binary). * - * The @github/copilot package only exposes an ESM-only "./sdk" export, - * which breaks in CJS contexts (e.g., VS Code extensions bundled with esbuild). - * Instead of resolving through the package's exports, we locate the package - * root by walking module resolution paths and checking for its directory. - * See: https://github.com/github/copilot-sdk/issues/528 + * In ESM, uses import.meta.resolve directly. In CJS (e.g., VS Code extensions + * bundled with esbuild format:"cjs"), import.meta is empty so we fall back to + * walking node_modules to find the package. */ function getBundledCliPath(): string { - // import.meta.url is defined in ESM; in CJS bundles (esbuild format:"cjs") - // it's undefined, so we fall back to __filename via pathToFileURL. - const require = createRequire(import.meta.url ?? pathToFileURL(__filename).href); - // The @github/copilot package has strict ESM-only exports, so require.resolve - // cannot resolve it. Instead, walk the module resolution paths to find it. - const searchPaths = require.resolve.paths("@github/copilot") ?? []; + if (typeof import.meta.resolve === "function") { + // ESM: resolve via import.meta.resolve + const sdkUrl = import.meta.resolve("@github/copilot/sdk"); + const sdkPath = fileURLToPath(sdkUrl); + // sdkPath is like .../node_modules/@github/copilot/sdk/index.js + // Go up two levels to get the package root, then append index.js + return join(dirname(dirname(sdkPath)), "index.js"); + } + + // CJS fallback: the @github/copilot package has ESM-only exports so + // require.resolve cannot reach it. Walk the module search paths instead. + const req = createRequire(__filename); + const searchPaths = req.resolve.paths("@github/copilot") ?? []; for (const base of searchPaths) { const candidate = join(base, "@github", "copilot", "index.js"); if (existsSync(candidate)) { @@ -113,7 +118,8 @@ function getBundledCliPath(): string { } } throw new Error( - `Could not find @github/copilot package. Searched ${searchPaths.length} paths. Ensure it is installed.` + `Could not find @github/copilot package. Searched ${searchPaths.length} paths. ` + + `Ensure it is installed, or pass cliPath/cliUrl to CopilotClient.`, ); } diff --git a/nodejs/test/cjs-compat.test.ts b/nodejs/test/cjs-compat.test.ts index e04fc400c..e6e4fa49c 100644 --- a/nodejs/test/cjs-compat.test.ts +++ b/nodejs/test/cjs-compat.test.ts @@ -1,10 +1,8 @@ /** - * CJS shimmed environment compatibility test + * Dual ESM/CJS build compatibility tests * - * Verifies that getBundledCliPath() works when the ESM build is loaded in a - * shimmed CJS environment (e.g., VS Code extensions bundled with esbuild - * format:"cjs"). In these environments, import.meta.url may be undefined but - * __filename is available via the CJS shim. + * Verifies that both the ESM and CJS builds exist and work correctly, + * so consumers using either module system get a working package. * * See: https://github.com/github/copilot-sdk/issues/528 */ @@ -14,30 +12,43 @@ import { existsSync } from "node:fs"; import { execFileSync } from "node:child_process"; import { join } from "node:path"; -const esmEntryPoint = join(import.meta.dirname, "../dist/index.js"); +const distDir = join(import.meta.dirname, "../dist"); -describe("CJS shimmed environment compatibility (#528)", () => { +describe("Dual ESM/CJS build (#528)", () => { it("ESM dist file should exist", () => { - expect(existsSync(esmEntryPoint)).toBe(true); + expect(existsSync(join(distDir, "index.js"))).toBe(true); }); - it("getBundledCliPath() should resolve in a CJS shimmed context", () => { - // Simulate what esbuild format:"cjs" does: __filename is defined, - // import.meta.url may be undefined. The SDK's fallback logic - // (import.meta.url ?? pathToFileURL(__filename).href) handles this. - // - // We test by requiring the ESM build via --input-type=module in a - // subprocess that has __filename available, verifying the constructor - // (which calls getBundledCliPath()) doesn't throw. + it("CJS dist file should exist", () => { + expect(existsSync(join(distDir, "cjs/index.js"))).toBe(true); + }); + + it("CJS build is requireable and exports CopilotClient", () => { const script = ` - import { createRequire } from 'node:module'; - const require = createRequire(import.meta.url); - const sdk = await import(${JSON.stringify(esmEntryPoint)}); + const sdk = require(${JSON.stringify(join(distDir, "cjs/index.js"))}); if (typeof sdk.CopilotClient !== 'function') { + console.error('CopilotClient is not a function'); process.exit(1); } + console.log('CJS require: OK'); + `; + const output = execFileSync( + process.execPath, + ["--eval", script], + { + encoding: "utf-8", + timeout: 10000, + cwd: join(import.meta.dirname, ".."), + }, + ); + expect(output).toContain("CJS require: OK"); + }); + + it("CopilotClient constructor works in CJS context", () => { + const script = ` + const sdk = require(${JSON.stringify(join(distDir, "cjs/index.js"))}); try { - const client = new sdk.CopilotClient({ cliUrl: "8080" }); + const client = new sdk.CopilotClient({ cliUrl: "http://localhost:8080" }); console.log('CopilotClient constructor: OK'); } catch (e) { console.error('constructor failed:', e.message); @@ -46,7 +57,7 @@ describe("CJS shimmed environment compatibility (#528)", () => { `; const output = execFileSync( process.execPath, - ["--input-type=module", "--eval", script], + ["--eval", script], { encoding: "utf-8", timeout: 10000, From 345e7efd1dc54476389be6623ab3891819699f54 Mon Sep 17 00:00:00 2001 From: Steve Sanderson Date: Thu, 19 Mar 2026 16:31:17 +0000 Subject: [PATCH 4/7] ci(nodejs): add build step before tests The CJS compatibility tests verify dist/ output, which requires a build. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- .github/workflows/nodejs-sdk-tests.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/nodejs-sdk-tests.yml b/.github/workflows/nodejs-sdk-tests.yml index 9e978a22f..9dec01667 100644 --- a/.github/workflows/nodejs-sdk-tests.yml +++ b/.github/workflows/nodejs-sdk-tests.yml @@ -62,6 +62,9 @@ jobs: - name: Typecheck SDK run: npm run typecheck + - name: Build SDK + run: npm run build + - name: Install test harness dependencies working-directory: ./test/harness run: npm ci --ignore-scripts From b975f81de408473b21f82b9bf7b782cb5cf806c6 Mon Sep 17 00:00:00 2001 From: Steve Sanderson Date: Thu, 19 Mar 2026 16:33:15 +0000 Subject: [PATCH 5/7] style(nodejs): fix prettier formatting in changed files Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- nodejs/src/client.ts | 2 +- nodejs/test/cjs-compat.test.ts | 28 ++++++++++------------------ 2 files changed, 11 insertions(+), 19 deletions(-) diff --git a/nodejs/src/client.ts b/nodejs/src/client.ts index af466bf34..46d932242 100644 --- a/nodejs/src/client.ts +++ b/nodejs/src/client.ts @@ -119,7 +119,7 @@ function getBundledCliPath(): string { } throw new Error( `Could not find @github/copilot package. Searched ${searchPaths.length} paths. ` + - `Ensure it is installed, or pass cliPath/cliUrl to CopilotClient.`, + `Ensure it is installed, or pass cliPath/cliUrl to CopilotClient.` ); } diff --git a/nodejs/test/cjs-compat.test.ts b/nodejs/test/cjs-compat.test.ts index e6e4fa49c..6d392136b 100644 --- a/nodejs/test/cjs-compat.test.ts +++ b/nodejs/test/cjs-compat.test.ts @@ -32,15 +32,11 @@ describe("Dual ESM/CJS build (#528)", () => { } console.log('CJS require: OK'); `; - const output = execFileSync( - process.execPath, - ["--eval", script], - { - encoding: "utf-8", - timeout: 10000, - cwd: join(import.meta.dirname, ".."), - }, - ); + const output = execFileSync(process.execPath, ["--eval", script], { + encoding: "utf-8", + timeout: 10000, + cwd: join(import.meta.dirname, ".."), + }); expect(output).toContain("CJS require: OK"); }); @@ -55,15 +51,11 @@ describe("Dual ESM/CJS build (#528)", () => { process.exit(1); } `; - const output = execFileSync( - process.execPath, - ["--eval", script], - { - encoding: "utf-8", - timeout: 10000, - cwd: join(import.meta.dirname, ".."), - }, - ); + const output = execFileSync(process.execPath, ["--eval", script], { + encoding: "utf-8", + timeout: 10000, + cwd: join(import.meta.dirname, ".."), + }); expect(output).toContain("CopilotClient constructor: OK"); }); }); From c472d79dccbf291493a9ae37206c0e8e80f9e927 Mon Sep 17 00:00:00 2001 From: Steve Sanderson Date: Thu, 19 Mar 2026 16:36:40 +0000 Subject: [PATCH 6/7] test(nodejs): verify CLI path resolution in both ESM and CJS builds Replace the cliUrl-based test (which skipped getBundledCliPath()) with tests that construct CopilotClient without cliUrl, actually exercising the bundled CLI resolution in both module formats. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- nodejs/test/cjs-compat.test.ts | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/nodejs/test/cjs-compat.test.ts b/nodejs/test/cjs-compat.test.ts index 6d392136b..f57403725 100644 --- a/nodejs/test/cjs-compat.test.ts +++ b/nodejs/test/cjs-compat.test.ts @@ -40,22 +40,33 @@ describe("Dual ESM/CJS build (#528)", () => { expect(output).toContain("CJS require: OK"); }); - it("CopilotClient constructor works in CJS context", () => { + it("CJS build resolves bundled CLI path", () => { const script = ` const sdk = require(${JSON.stringify(join(distDir, "cjs/index.js"))}); - try { - const client = new sdk.CopilotClient({ cliUrl: "http://localhost:8080" }); - console.log('CopilotClient constructor: OK'); - } catch (e) { - console.error('constructor failed:', e.message); - process.exit(1); - } + const client = new sdk.CopilotClient({ autoStart: false }); + console.log('CJS CLI resolved: OK'); `; const output = execFileSync(process.execPath, ["--eval", script], { encoding: "utf-8", timeout: 10000, cwd: join(import.meta.dirname, ".."), }); - expect(output).toContain("CopilotClient constructor: OK"); + expect(output).toContain("CJS CLI resolved: OK"); + }); + + it("ESM build resolves bundled CLI path", () => { + const esmPath = join(distDir, "index.js"); + const script = ` + import { pathToFileURL } from 'node:url'; + const sdk = await import(pathToFileURL(${JSON.stringify(esmPath)}).href); + const client = new sdk.CopilotClient({ autoStart: false }); + console.log('ESM CLI resolved: OK'); + `; + const output = execFileSync(process.execPath, ["--input-type=module", "--eval", script], { + encoding: "utf-8", + timeout: 10000, + cwd: join(import.meta.dirname, ".."), + }); + expect(output).toContain("ESM CLI resolved: OK"); }); }); From a911404303683c268c95fa5a66174d53fc0a0cf5 Mon Sep 17 00:00:00 2001 From: Steve Sanderson Date: Thu, 19 Mar 2026 16:41:23 +0000 Subject: [PATCH 7/7] build(nodejs): suppress expected empty-import-meta warning in CJS build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The CJS build intentionally produces empty import.meta — our runtime code detects this and falls back to createRequire. Silence the esbuild warning to avoid confusing contributors. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- nodejs/esbuild-copilotsdk-nodejs.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/nodejs/esbuild-copilotsdk-nodejs.ts b/nodejs/esbuild-copilotsdk-nodejs.ts index 0467bca7a..f65a47236 100644 --- a/nodejs/esbuild-copilotsdk-nodejs.ts +++ b/nodejs/esbuild-copilotsdk-nodejs.ts @@ -26,6 +26,7 @@ await esbuild.build({ target: "es2022", sourcemap: false, outExtension: { ".js": ".js" }, + logOverride: { "empty-import-meta": "silent" }, }); // Mark the CJS directory so Node treats .js files as CommonJS