claude-code - 💡(How to fix) Fix VS Code extension v2.1.136 fails to activate on Windows — createRequire regression returns (hardcoded /home/runner/work/... path)

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

[info] ExtensionService#_doActivateExtension Anthropic.claude-code, startup: false, activationEvent: 'onStartupFinished' [error] Activating extension Anthropic.claude-code failed due to an error: [error] TypeError: The argument 'filename' must be a file URL object, file URL string, or absolute path string. Received 'file:///home/runner/work/claude-cli-internal/claude-cli-internal/build-agent-sdk/sdk.mjs' at Module.createRequire (node:internal/modules/cjs/loader:1922:13) at Object.<anonymous> (c:\Users\Emerick.vscode\extensions\anthropic.claude-code-2.1.136-win32-x64\extension.js:103:5579) at Module._compile (node:internal/modules/cjs/loader:1713:14) at Module._extensions..js (node:internal/modules/cjs/loader:1847:10) at Module.load (node:internal/modules/cjs/loader:1448:32) at Module._load (node:internal/modules/cjs/loader:1270:12) at c._load (node:electron/js2c/node_init:2:18041) at i._load (file:///c:/Users/Emerick/AppData/Local/Programs/Microsoft%20VS%20Code/8b640eef5a/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:806:6589) at n._load (file:///c:/Users/Emerick/AppData/Local/Programs/Microsoft%20VS%20Code/8b640eef5a/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:652:28855) at TracingChannel.traceSync (node:diagnostics_channel:328:14) at wrapModuleLoad (node:internal/modules/cjs/loader:244:24) at Module.require (node:internal/modules/cjs/loader:1470:12)

Fix Action

Fix / Workaround

Workaround that confirms the cause: roll back to v2.1.131 via Extensions → "Install Another Version", then disable auto-update on the extension. Activation succeeds and commands work.

Code Example

[info] ExtensionService#_doActivateExtension Anthropic.claude-code, startup: false, activationEvent: 'onStartupFinished'
[error] Activating extension Anthropic.claude-code failed due to an error:
[error] TypeError: The argument 'filename' must be a file URL object, file URL string, or absolute path string. Received 'file:///home/runner/work/claude-cli-internal/claude-cli-internal/build-agent-sdk/sdk.mjs'
    at Module.createRequire (node:internal/modules/cjs/loader:1922:13)
    at Object.<anonymous> (c:\Users\Emerick\.vscode\extensions\anthropic.claude-code-2.1.136-win32-x64\extension.js:103:5579)
    at Module._compile (node:internal/modules/cjs/loader:1713:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1847:10)
    at Module.load (node:internal/modules/cjs/loader:1448:32)
    at Module._load (node:internal/modules/cjs/loader:1270:12)
    at c._load (node:electron/js2c/node_init:2:18041)
    at i._load (file:///c:/Users/Emerick/AppData/Local/Programs/Microsoft%20VS%20Code/8b640eef5a/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:806:6589)
    at n._load (file:///c:/Users/Emerick/AppData/Local/Programs/Microsoft%20VS%20Code/8b640eef5a/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:652:28855)
    at TracingChannel.traceSync (node:diagnostics_channel:328:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:244:24)
    at Module.require (node:internal/modules/cjs/loader:1470:12)
RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

The Claude Code VS Code extension v2.1.136 fails to activate on Windows. The extension is stuck on "Activating..." indefinitely in the Extensions panel, and every command it registers fails — for example, the Command Palette shows command 'claude-vscode.editor.openLast' not found.

The Extension Host log shows that during activation the extension calls Module.createRequire with a hardcoded Linux CI path baked into the published Windows bundle:

file:///home/runner/work/claude-cli-internal/claude-cli-internal/build-agent-sdk/sdk.mjs

Windows correctly rejects this as not a valid filename, so activation aborts.

This is a recurrence of a bug that has already been fixed three times:

  • #28081 (v2.1.51)
  • #28397 (v2.1.53)
  • #28416 (v2.1.55)

The same /home/runner/work/... GitHub Actions runner path is leaking into the published extension.js again in v2.1.136.

What Should Happen?

The extension should activate successfully on Windows, register its commands, and be usable. The published win32-x64 bundle must not contain hardcoded /home/runner/work/... paths from the GitHub Actions build environment — those paths should be resolved to the local extension install directory at runtime (or bundled as a relative reference).

Error Messages/Logs

[info] ExtensionService#_doActivateExtension Anthropic.claude-code, startup: false, activationEvent: 'onStartupFinished'
[error] Activating extension Anthropic.claude-code failed due to an error:
[error] TypeError: The argument 'filename' must be a file URL object, file URL string, or absolute path string. Received 'file:///home/runner/work/claude-cli-internal/claude-cli-internal/build-agent-sdk/sdk.mjs'
    at Module.createRequire (node:internal/modules/cjs/loader:1922:13)
    at Object.<anonymous> (c:\Users\Emerick\.vscode\extensions\anthropic.claude-code-2.1.136-win32-x64\extension.js:103:5579)
    at Module._compile (node:internal/modules/cjs/loader:1713:14)
    at Module._extensions..js (node:internal/modules/cjs/loader:1847:10)
    at Module.load (node:internal/modules/cjs/loader:1448:32)
    at Module._load (node:internal/modules/cjs/loader:1270:12)
    at c._load (node:electron/js2c/node_init:2:18041)
    at i._load (file:///c:/Users/Emerick/AppData/Local/Programs/Microsoft%20VS%20Code/8b640eef5a/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:806:6589)
    at n._load (file:///c:/Users/Emerick/AppData/Local/Programs/Microsoft%20VS%20Code/8b640eef5a/resources/app/out/vs/workbench/api/node/extensionHostProcess.js:652:28855)
    at TracingChannel.traceSync (node:diagnostics_channel:328:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:244:24)
    at Module.require (node:internal/modules/cjs/loader:1470:12)

Steps to Reproduce

  1. On Windows 10/11, install the Anthropic.claude-code extension v2.1.136 from the VS Code Marketplace.
  2. Reload the VS Code window: Ctrl+Shift+P → "Developer: Reload Window".
  3. Observe the Extensions panel: "Claude Code" stays in the "Activating..." state indefinitely.
  4. Open Command Palette and run any Claude Code command (e.g. "Claude Code: Open Last") — it fails with command 'claude-vscode.editor.openLast' not found.
  5. Open Output panel → "Log (Extension Host)" to see the activation TypeError above.

Workaround that confirms the cause: roll back to v2.1.131 via Extensions → "Install Another Version", then disable auto-update on the extension. Activation succeeds and commands work.

Claude Model

Other

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.1.131

Claude Code Version

The bug is in the VS Code extension (v2.1.136), but include the CLI version for completeness; note this in the Additional Information field.

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

PowerShell

Additional Information

This bug is in the VS Code extension v2.1.136 (anthropic.claude-code-2.1.136-win32-x64), not the claude CLI itself. The CLI runs fine.

This is the fourth recurrence of the same createRequire / /home/runner/work/... packaging issue (previously: #28081, #28397, #28416). A pre-publish guard in CI that greps the packaged extension.js for any /home/runner/, /build-agent-sdk/, or claude-cli-internal literal would catch the regression before release. A smoke-test that loads the packaged win32 bundle during the release pipeline would be even better.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING