Bug
@github/copilot-sdk@0.1.31 crashes on startup under Node.js v24 due to a missing .js file extension on a new import added to dist/session.js.
Same class of defect as #8 (fixed in 0.1.10/0.1.11 for client.js).
Error
Error [ERR_MODULE_NOT_FOUND]: Cannot find module
'.../node_modules/vscode-jsonrpc/node'
imported from .../node_modules/@github/copilot-sdk/dist/session.js
Did you mean to import "vscode-jsonrpc/node.js"?
Root Cause
SDK 0.1.31 added a new import to dist/session.js (not present in 0.1.29) that omits the .js extension:
# 0.1.31 session.js line 1 -- NEW import, missing .js
import { ConnectionError, ResponseError } from "vscode-jsonrpc/node";
# 0.1.31 client.js line 10 -- existing import, correct
} from "vscode-jsonrpc/node.js";
The SDK declares "type": "module" (ESM). The dependency vscode-jsonrpc@8.2.1 has no exports map and no "type" field. Without an exports map, Node ESM resolution does not auto-append .js for subpath imports, so "vscode-jsonrpc/node" fails to resolve even though node.js exists in the package root.
dist/client.js already uses the correct "vscode-jsonrpc/node.js" form -- the new session.js import simply did not follow the same convention.
Diff: 0.1.29 / 0.1.30 vs 0.1.31
| File |
0.1.29 |
0.1.30 |
0.1.31 |
dist/session.js |
No vscode-jsonrpc import |
No vscode-jsonrpc import |
import { ConnectionError, ResponseError } from "vscode-jsonrpc/node" (missing .js) |
dist/client.js |
from "vscode-jsonrpc/node.js" |
from "vscode-jsonrpc/node.js" |
from "vscode-jsonrpc/node.js" (unchanged, correct) |
Environment
- Affected: 0.1.31
- Working: 0.1.29, 0.1.30
- Node.js: v24.14.0
- OS: Linux
Workaround
Pin to 0.1.30 (or 0.1.29):
"@github/copilot-sdk": "0.1.30"
Suggested Fix
Add .js to the import in the source that produces dist/session.js:
import { ConnectionError, ResponseError } from "vscode-jsonrpc/node.js";
Bug
@github/copilot-sdk@0.1.31crashes on startup under Node.js v24 due to a missing.jsfile extension on a new import added todist/session.js.Same class of defect as #8 (fixed in 0.1.10/0.1.11 for
client.js).Error
Root Cause
SDK 0.1.31 added a new import to
dist/session.js(not present in 0.1.29) that omits the.jsextension:The SDK declares
"type": "module"(ESM). The dependencyvscode-jsonrpc@8.2.1has noexportsmap and no"type"field. Without an exports map, Node ESM resolution does not auto-append.jsfor subpath imports, so"vscode-jsonrpc/node"fails to resolve even thoughnode.jsexists in the package root.dist/client.jsalready uses the correct"vscode-jsonrpc/node.js"form -- the newsession.jsimport simply did not follow the same convention.Diff: 0.1.29 / 0.1.30 vs 0.1.31
dist/session.jsimport { ConnectionError, ResponseError } from "vscode-jsonrpc/node"(missing .js)dist/client.jsfrom "vscode-jsonrpc/node.js"from "vscode-jsonrpc/node.js"from "vscode-jsonrpc/node.js"(unchanged, correct)Environment
Workaround
Pin to 0.1.30 (or 0.1.29):
Suggested Fix
Add
.jsto the import in the source that producesdist/session.js: