Skip to content

TypeError: Cannot read properties of undefined (reading 'prototype') when running happyΒ #85

@bmpimentel9

Description

@bmpimentel9

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:

  1. Install Node.js v25.2.1 via Homebrew
  2. Install happy-coder: npm install -g happy-coder
  3. Install Claude Code separately: curl -fsSL https://claude.ai/install.sh | bash (version 2.0.60)
  4. 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:

  1. Updating the bundled Claude Code version in happy-coder
  2. Making happy-coder use the system-installed Claude Code CLI instead of bundling it
  3. Adding better error handling for version compatibility issues

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions