-
Notifications
You must be signed in to change notification settings - Fork 200
Description
Title: TypeError: Cannot read properties of undefined (reading 'prototype') when running happy
Description:
After installing happy-coder globally via npm, the CLI fails to start with a TypeError related to the bundled Claude Code version.
Steps to Reproduce:
- Install Node.js v25.2.1 via Homebrew
- Install happy-coder: npm install -g happy-coder
- Install Claude Code separately: curl -fsSL https://claude.ai/install.sh | bash (version 2.0.60)
- Run happy --version or just happy
Expected Behavior:
Happy should start normally and display the authentication options (Mobile App or Web Browser).
Actual Behavior:
The command crashes with the following error:
happy version: 0.11.2
TypeError: Cannot read properties of undefined (reading 'prototype')
at file:///opt/homebrew/lib/node_modules/happy-coder/node_modules/@anthropic-ai/claude-code/cli.js:707:25327
at file:///opt/homebrew/lib/node_modules/happy-coder/node_modules/@anthropic-ai/claude-code/cli.js:8:402
at file:///opt/homebrew/lib/node_modules/happy-coder/node_modules/@anthropic-ai/claude-code/cli.js:707:25447
at file:///opt/homebrew/lib/node_modules/happy-coder/node_modules/@anthropic-ai/claude-code/cli.js:8:402
at file:///opt/homebrew/lib/node_modules/happy-coder/node_modules/@anthropic-ai/claude-code/cli.js:709:3204
at file:///opt/homebrew/lib/node_modules/happy-coder/node_modules/@anthropic-ai/claude-code/cli.js:8:402
at file:///opt/homebrew/lib/node_modules/happy-coder/node_modules/@anthropic-ai/claude-code/cli.js:709:6226
at file:///opt/homebrew/lib/node_modules/happy-coder/node_modules/@anthropic-ai/claude-code/cli.js:8:402
at file:///opt/homebrew/lib/node_modules/happy-coder/node_modules/@anthropic-ai/claude-code/cli.js:709:7408
at file:///opt/homebrew/lib/node_modules/happy-coder/node_modules/@anthropic-ai/claude-code/cli.js:8:402
Node.js v25.2.1
Environment:
- OS: macOS (Apple Silicon)
- Node.js: v25.2.1
- npm: Latest version from Homebrew
- happy-coder: v0.11.2 (latest from npm)
- Claude Code (standalone): v2.0.60 (installed separately, works fine)
Additional Context:
The error appears to be in the bundled version of @anthropic-ai/claude-code that ships with happy-coder. The standalone Claude Code CLI (v2.0.60) works perfectly when run directly with the claude command.
The issue seems to be that happy-coder is trying to use its bundled/vendored version of Claude Code which has a compatibility issue, possibly with the newer Node.js version or missing dependencies.
Workaround:
Installing Claude Code separately and using it directly works fine. However, this defeats the purpose of using happy-coder for mobile access.
Suggested Fix:
Consider either:
- Updating the bundled Claude Code version in happy-coder
- Making happy-coder use the system-installed Claude Code CLI instead of bundling it
- Adding better error handling for version compatibility issues