Skip to content

ERR_MODULE_NOT_FOUND in 0.1.31: session.js missing .js extension on vscode-jsonrpc/node import #707

@paulwhitten

Description

@paulwhitten

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";

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-investigationRoot cause unclear, needs human review

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions