[BUG] Websocket constructor not found if `DEV=true` is in the environment

Resolved 💬 8 comments Opened Jun 13, 2025 by jorgeavaldez Closed Jan 15, 2026

Environment

  • Platform (select one):
  • [x] Anthropic API
  • [ ] AWS Bedrock
  • [ ] Google Vertex AI
  • [ ] Other: <!-- specify -->
  • Claude CLI version: 1.0.22 (Claude Code)
  • Operating System: Manjaro Linux 25.0.3
  • Terminal: WezTerm

Bug Description

When the environment variable DEV is set to a non-falsy value, claude results in the following error on startup:

$ claude
╭──────────────────────────╮
│ ✻ Welcome to Claude Code │
╰──────────────────────────╯

file:///home/redacted/file/path/node_modules/@anthropic-ai/claude-code/cli.js:227

# ... minified stacktrace

TypeError: window.WebSocket is not a constructor
    at Module.Q01 (file:///home/redacted/file/path/node_modules/@anthropic-ai/claude-code/cli.js:227:20201)
    at file:///home/redacted/file/path/node_modules/@anthropic-ai/claude-code/cli.js:227:22891
    at file:///home/redacted/file/path/node_modules/@anthropic-ai/claude-code/cli.js:7:570
    at file:///home/redacted/file/path/node_modules/@anthropic-ai/claude-code/cli.js:674:8873

Node.js v24.2.0

Calling claude with DEV=false results in it starting up correctly.

Steps to Reproduce

  1. export DEV=true
  2. claude
  3. Error!
  4. export DEV=false
  5. claude
  6. Success!

Expected Behavior

It should work regardless of my local environment variables

Actual Behavior

It does not work with regards to my local environment variables

View original on GitHub ↗

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