[BUG] VS Code extension crashes with Bun TypeError on Linux - "Expected CommonJS module to have a function wrapper"

Resolved 💬 3 comments Opened Jan 11, 2026 by galaczi Closed Jan 16, 2026

Preflight Checklist

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

What's Wrong?

The Claude Code VS Code extension crashes immediately on startup with a Bun TypeError. The native CLI installed via curl -fsSL https://claude.ai/install.sh | bash works perfectly, but the VS Code extension's bundled Bun binary fails.

Error message:

TypeError: Expected CommonJS module to have a function wrapper. If you weren't messing around with Bun's internals, this is a bug in Bun

Bun v1.3.5 (Linux x64 baseline)

Full log output:

2026-01-11 19:51:50.179 [info] From claude:  6 |     "use strict";
 7 | 
 8 |     //
 9 |     if (entry.instantiate)
10 |         return entry.instantiate;
11 |     var instantiatePromise = (async () => {
                                               ^
TypeError: Expected CommonJS module to have a function wrapper. If you weren't messing around with Bun's internals, this is a bug in Bun

Bun v1.3.5 (Linux x64 baseline)

2026-01-11 19:51:50.194 [info] Closing Claude on channel: kpq845f5igj
2026-01-11 19:51:50.194 [error] Error from Claude (on channel kpq845f5igj): Error: Claude Code process exited with code 1

What Should Happen?

The VS Code extension should start normally and display the Claude Code UI panel.

Error Messages/Logs

2026-01-11 19:51:50.179 [info] From claude:  6 |     "use strict";
 7 | 
 8 |     //
 9 |     if (entry.instantiate)
10 |         return entry.instantiate;
11 |     var instantiatePromise = (async () => {
                                               ^
TypeError: Expected CommonJS module to have a function wrapper. If you weren't messing around with Bun's internals, this is a bug in Bun

Bun v1.3.5 (Linux x64 baseline)

2026-01-11 19:51:50.194 [info] Closing Claude on channel: kpq845f5igj
2026-01-11 19:51:50.194 [error] Error from Claude (on channel kpq845f5igj): Error: Claude Code process exited with code 1

Steps to Reproduce

  1. Install Claude Code VS Code extension (latest version) on Linux
  2. Open VS Code
  3. Click on the Claude Code icon or open the Claude Code panel
  4. Extension crashes immediately with the above error

Claude Model

Opus

Is this a regression?

Yes, this worked in a previous version

Last Working Version

2.1.4

Claude Code Version

2.1.5

Platform

Anthropic API

Operating System

Ubuntu/Debian Linux

Terminal/Shell

VS Code integrated terminal

Additional Information

_No response_

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗