[VS Code Extension] v2.1.129 fails to activate on Windows: hardcoded Linux CI path in bundled SDK (regression)
Summary
The VS Code extension Anthropic.claude-code v2.1.129 (win32-x64) fails to activate on Windows. A Linux GitHub Actions runner path is hardcoded inside the bundled extension.js, causing a TypeError during the onStartupFinished activation event. Because the extension never activates, none of its commands (e.g. claude-vscode.editor.openLast) are registered, and clicking the editor-title "Claude Code: Open" button produces command 'claude-vscode.editor.openLast' not found.
This is a regression of an issue that has been reported and closed repeatedly across releases:
- #28073 / #28100 (v2.1.51)
- #28416 / #28418 (v2.1.55)
- #37098 (v2.1.81)
- #41383 (also
command 'claude-vscode.editor.openLast' not foundon Windows activation failure)
The same bundling defect keeps reappearing — strongly suggests there is no Windows smoke test for the packaged extension in CI.
Environment
- OS: Windows 11 Pro 10.0.26200
- VS Code: 1.118.1 (x64), commit
034f571df509819cc10b0c8129f66ef77a542f0e - Extension:
Anthropic.claude-codev2.1.129, targetwin32-x64 - Previous version 2.1.128 activates correctly (but does not contribute the
claude-vscode.editor.openLastcommand).
Stack trace (from exthost.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 Object.<anonymous> (c:\Users\<user>\.vscode\extensions\anthropic.claude-code-2.1.129-win32-x64\extension.js:102:5407)
Repro
- Install
Anthropic.claude-codev2.1.129 on Windows (VS Code 1.118.x). - Restart VS Code.
- Open any workspace and click the "Claude Code: Open" icon contributed to the editor title bar.
- Observe
command 'claude-vscode.editor.openLast' not found. - Open Output → "Extension Host" → see the activation
TypeErrorabove.
Likely cause
At extension.js:102:5407 the bundle appears to call require() / createRequire() / fileURLToPath() (or similar) with a literal absolute path captured at build time on the Linux CI runner: file:///home/runner/work/claude-cli-internal/claude-cli-internal/build-agent-sdk/sdk.mjs. On non-Linux machines this path doesn't exist and Node rejects it.
Workaround
Downgrade to v2.1.128 via Extensions → ⚙ → "Install Another Version..." (note: 2.1.128 doesn't contribute the editor "Open" button, but the extension activates and the rest of the commands work via the Command Palette).
Asks
- Re-publish 2.1.129 with the SDK path resolved relative to
__dirname/ extension URI (or viaimport.meta.url) rather than the build-time absolute path. - Add a Windows smoke test that activates the packaged extension in CI so this regression stops recurring across releases.
13 Comments
Root-cause analysis of the bundled
extension.js(v2.1.129, win32-x64)I unpacked the
win32-x64VSIX and located two occurrences of the hardcoded CI path insideextension/extension.js. Both are produced by the same bundler defect; only the first one breaks activation because it runs at module load.Occurrence #1 — top-level, kills activation
Around
extension.js:102(byte ~669,201):Aiis the bundlednode:module. Because thiscreateRequire(...)call is evaluated at module load, the extension throws duringonStartupFinishedand never registers any commands — hencecommand 'claude-vscode.editor.openLast' not found.Occurrence #2 — inside CLI-resolution path, latent
Later in the bundle (byte ~1,345,663):
This branch runs the same broken pattern but inside a function (looks like the resolver for
cli.js/ native CLI). Even if you fix occurrence #1, this one will throw the sameTypeErrorthe moment it executes on Windows. Worth fixing both in the same change.Why the bundler emitted these literals
In the source these almost certainly were:
When the ESM source
build-agent-sdk/sdk.mjsis bundled into a CJS extension,import.meta.urlhas no CJS equivalent. esbuild (and a few other bundlers) replace it with the absolutefile://URL of the source file at build time unless you tell them otherwise. That URL only exists on the GitHub Actions runner —/home/runner/work/...— so on a user's Windows box, bothnode:module.createRequire(...)andnode:url.fileURLToPath(...)reject the input as not pointing at a real file.Suggested fixes (any of these works)
import.meta.urlwith a runtime-safe expression. For esbuild:``
js
``// esbuild.config.mjs
define: {
'import.meta.url': 'require("url").pathToFileURL(__filename).href',
}
import.meta.urlforcreateRequire/fileURLToPath. Use__filename(works in the CJS output and is rewritten correctly by every major bundler):``
js
``import { createRequire } from 'node:module';
const require = createRequire(__filename);
import.meta.urlin source, inject a runtime equivalent at the top of the CJS bundle:``
jsvar __import_meta_url = require('url').pathToFileURL(__filename).href;// esbuild banner.js
banner: {
js:
``}
// and post-process: import.meta.url -> __import_meta_url
CI gap
The fact that this exact class of bug shipped in 2.1.51, 2.1.55, 2.1.81 and now 2.1.129 means the build pipeline doesn't catch it. A one-line smoke test in CI would:
If activation throws, fail the build. That alone would have stopped every recurrence of this bug from ever shipping.
---
Happy to provide the unpacked
extension.jsbyte offsets / hex dump if useful.+1, reproduced on Windows 11 with VS Code 1.118.1 and extension v2.1.129 (win32-x64). Same
TypeErroratextension.js:102:5407during theonStartupFinishedactivation event, so allclaude-vscode.*commands fail withcommand not found. Downgrading to 2.1.128 restores activation.Environment
034f571df509819cc10b0c8129f66ef77a542f0eanthropic.claude-code2.1.129 (win32-x64)Workaround found — downgrade to v2.1.109
Confirmed this affects all Windows users on v2.1.111–2.1.129.
Root cause:
extension.jscallscreateRequire("file:///home/runner/work/claude-cli-internal/...")at top-level — hardcoded Linux CI path crashes on Windows immediately on activation.Temporary fix:
anthropic.claude-code-2.1.111through2.1.129foldersanthropic.claude-code-2.1.109-win32-x64extensions.jsonin the same folder — update the Claude Code entry:"version"to"2.1.109""fsPath"and"path"to point to the 2.1.109 folder"pinned": trueto prevent auto-update back to broken versionQuestion for the team: Is there a hotfix planned? And can
pinned: trueinextensions.jsonreliably prevent auto-update, or is there another recommended way to stay on a specific version?Follow-up: the bug is older than the activation symptom suggests
To verify @ThinhHoangTitan's claim that 2.1.109 is "100% safe", I unpacked the
win32-x64VSIX of 2.1.109 and 2.1.128 and grepped for the same hardcoded path. Both still contain it:| Version | Occurrences of
home/runner/work/...sdk.mjs| Top-level call? | Activation breaks on Windows? ||---|---|---|---|
| 2.1.109 | 1 | ❌ no — only inside the native-CLI resolver | ❌ no |
| 2.1.128 | 1 | ❌ no — same lazy branch as 2.1.109 | ❌ no |
| 2.1.129 | 2 | ✅ yes — top-level
Ai.createRequire(...)atextension.js:102| ✅ yes |The lazy occurrence (present in at least 2.1.109 → 2.1.128) lives here:
It only throws when the extension actually tries to resolve the bundled
cli.js(i.e. the native CLI invocation path). Most chat / panel features never hit it, which is why the bug stayed dormant across ≥20 releases. 2.1.129 is just the first release where someone added acreateRequire(import.meta.url)at module top-level, turning a latent bug into an activation failure.Implications
import.meta.urlhandling in the bundler config, not patch only the activation-time call. Otherwise the next time someone moves acreateRequire/fileURLToPathto the top level, the bug resurfaces.TypeErrorwill still surface from the lazy branch.Thanks for the detailed analysis @alexoDevMX.
Updated workaround: downgrade to 2.1.128 also works and is closer to the latest version.
+1 — confirming this regression on a separate Windows machine.
Environment
C:\Users\<user>\.local\bin\claude.exe)anthropic.claude-code-2.1.129-win32-x64Reproduction
Plugin/skill installs via Claude CLI silently triggered self-update from a previous working version to 2.1.129. After VS Code reload the panel rendered empty (Claude Code tab shows blank webview) and the keybinding popup surfaced
command 'claude-vscode.editor.openLast' not found.Stack trace (
exthost.log)The bundled
sdk.mjsreference resolves to the GitHub Actions runner's Linux path (/home/runner/...) which is a valid POSIX absolute path but is rejected by Node on Windows since it neither matches a Windows absolute path nor afile://URL the runtime accepts. The Linux-flavored string was inlined into the bundle at build time and never substituted on Windows install.Side effects observed beyond the empty panel
claude-vscode.*command IDs surfaced "command not found" toasts onCtrl+Shift+Ketc. (cosmetic, not the root cause).Workaround that fixed it
After reload the panel activates cleanly and editor responsiveness returns to normal.
Suggested fixes
__dirname/import.meta.urlbased resolver so the value is computed at runtime per-platform, not baked at build time.code.exeand assertsactivate()does not throw — this regression would have been caught.latestchannel until the hotfix ships, since the auto-updater is silently pulling Windows users into a broken state with no in-app indication.Happy to share the full
exthost.logprivately if helpful.Thanks for the report and very sorry for the disruption. We're getting a fix out for this right now, stand by.
I encountered the same problem on a Windows machine that had never had this extension installed before, so 2.1.129 was the starting point. Oddly enough, Claude recommended downgrading to 2.1.49, referring to a bug that was introduced in extension v2.1.51 where "the extension bundle contains a hardcoded Linux CI build path (file:///home/runner/work/...) baked into extension.js, which is invalid on Windows and causes the extension to fail activation entirely". Obviously, I didn't want to stay 80 versions behind, so I upgraded from 2.1.49 to 2.1.128, and the extension continued to work. (Upgrading again to 2.1.129 broke it again, so I just went back to 2.1.128.)
Thanks for the reports! This should now be resolved in 2.1.131, please update to pick up the fix.
Let us know if you run into any addition problems, thank you for your patience.
This seems to be happening again in version 2.1.136
I have same here. Encountered this on version 2.1.136.
Here is my environment for reference:
VSCode Version: 1.119.0 (user setup)
Date: 2026-05-05T11:23:50-07:00
Electron: 39.8.8
ElectronBuildId: 13870025
Chromium: 142.0.7444.265
Node.js: 22.22.1
V8: 14.2.231.22-electron.0
OS: Windows_NT x64 10.0.26200
I am getting this issue consistently
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.