claude-code - 💡(How to fix) Fix [BUG] Regression: createRequire fails with hardcoded Linux path on Windows — extension fails to activate (v2.1.129) [2 comments, 3 participants]

Official PRs (…)
ON THIS PAGE

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…
GitHub stats
anthropics/claude-code#56632Fetched 2026-05-07 03:49:22
View on GitHub
Comments
2
Participants
3
Timeline
9
Reactions
0
Timeline (top)
labeled ×5commented ×2closed ×1cross-referenced ×1

Error Message

Symptom: Extension shows infinite loading spinner in the sidebar, no error surfaced in UI. [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'

Error Messages/Logs

Root Cause

Symptom: Extension shows infinite loading spinner in the sidebar, no error surfaced in UI. Extension Host log: [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> (...\anthropic.claude-code-2.1.129-win32-x64\extension.js:102:5407) The hardcoded Linux CI build path is back in extension.js. Manually patching createRequire("file:///home/runner/...") to createRequire(__filename) resolves activation immediately, confirming this is the same root cause as the previously fixed issue. Suggests the build pipeline lost the fix or doesn't include a Windows smoke test for extension activation. Adding one would prevent further regressions of this kind.

Fix Action

Fix / Workaround

Symptom: Extension shows infinite loading spinner in the sidebar, no error surfaced in UI. Extension Host log: [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> (...\anthropic.claude-code-2.1.129-win32-x64\extension.js:102:5407) The hardcoded Linux CI build path is back in extension.js. Manually patching createRequire("file:///home/runner/...") to createRequire(__filename) resolves activation immediately, confirming this is the same root cause as the previously fixed issue. Suggests the build pipeline lost the fix or doesn't include a Windows smoke test for extension activation. Adding one would prevent further regressions of this kind.

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?

Regression confirmed in 2.1.129 on Windows 10 This bug, originally reported and fixed in the 2.1.51–2.1.55 range (#28054, #28056, #28076, #28085, #28397, #28416), has regressed in extension version 2.1.129. Environment:

OS: Windows 10 VS Code: 1.118.1 Extension: anthropic.claude-code-2.1.129-win32-x64 CLI: 2.1.129 (npm-global, working correctly from PowerShell — claude doctor passes all checks)

Symptom: Extension shows infinite loading spinner in the sidebar, no error surfaced in UI. Extension Host log: [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> (...\anthropic.claude-code-2.1.129-win32-x64\extension.js:102:5407) The hardcoded Linux CI build path is back in extension.js. Manually patching createRequire("file:///home/runner/...") to createRequire(__filename) resolves activation immediately, confirming this is the same root cause as the previously fixed issue. Suggests the build pipeline lost the fix or doesn't include a Windows smoke test for extension activation. Adding one would prevent further regressions of this kind.

What Should Happen?

Claude Code extension UI should run without hanging.

Error Messages/Logs

Steps to Reproduce

%USERPROFILE%.vscode\extensions\anthropic.claude-code-2.1.129-win32-x64\extension.js contains the following hardcoded string:

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

in createRequire() and fileURLToPath()

Claude Model

None

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.1.128

Claude Code Version

2.1.131

Platform

Anthropic API

Operating System

Windows

Terminal/Shell

VS Code integrated terminal

Additional Information

No response

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

claude-code - 💡(How to fix) Fix [BUG] Regression: createRequire fails with hardcoded Linux path on Windows — extension fails to activate (v2.1.129) [2 comments, 3 participants]