Skip to content

Bug Report: Cannot find module tree-sitter module on macOS arm64 #1454

Closed

Description

@lucaschallamel

Bug Report: Cannot find module tree-sitter module on macOS arm64

Environment
• OS: macOS arm64 (Apple Silicon)
• OpenCode Version: 0.3.87
• Installation Method: Tested with all three methods (curl install, npm, homebrew)
• System Bun Version: 1.2.19
• Shell: zsh 5.9

Description
OpenCode fails to start with a module loading error across all installation methods. The binary appears to be bundled with Bun v1.2.17 and cannot locate a required tree-sitter module.

Error Message

error: Cannot find module '/$bunfs/root/../tree-sitter-htesyypn.node' from '/$bunfs/root/opencode'
Bun v1.2.17 (macOS arm64)

Steps to Reproduce

  1. Install OpenCode using any of the documented methods:
   # Method 1: Curl install
   curl -fsSL https://opencode.ai/install | bash
   
   # Method 2: npm
   npm install -g opencode-ai
   
   # Method 3: Homebrew
   brew install sst/tap/opencode
  1. Run any OpenCode command:
   opencode --version
   # or
   opencode --help
   # or
   opencode auth login
  1. Error occurs immediately

Expected Behavior
OpenCode should start normally and display version information or help text.

Actual Behavior
All OpenCode commands fail with the tree-sitter module loading error.

Additional Context
• The error occurs regardless of installation method
• The bundled Bun version (v1.2.17) appears to be older than the current system Bun (v1.2.19)
• The error path /$bunfs/root/../tree-sitter-htesyypn.node suggests an issue with the bundled filesystem or module resolution
• Tested with clean installations after removing previous versions

Installation Paths Tested
• /opt/homebrew/bin/opencode (Homebrew)
• ~/.opencode/bin/opencode (curl install)
• ~/.nvm/versions/node/v22.16.0/lib/node_modules/opencode-ai/node_modules/opencode-darwin-arm64/bin/opencode (npm)

Debug Information

$ which opencode
/opt/homebrew/bin/opencode

$ ls -la /opt/homebrew/bin/opencode
lrwxr-xr-x  1 lucaschallamel  admin  48 Jul 31 06:58 /opt/homebrew/bin/opencode -> ../Cellar/opencode/0.3.87/bin/opencode

$ opencode --version
error: Cannot find module '/$bunfs/root/../tree-sitter-htesyypn.node' from '/$bunfs/root/opencode'

Bun v1.2.17 (macOS arm64)

Possible Cause
The bundled binary appears to have an incomplete or corrupted tree-sitter module, or the module path resolution is incorrect in the bundled Bun runtime.

Workaround
None found. The issue affects the core functionality and prevents any OpenCode usage.

This bug report provides all the essential information the maintainers will need to reproduce and fix the issue. Feel free to copy and paste it directly into a new GitHub issue on the OpenCode repository.

Activity

  1. thdxr commented on Jul 31, 2025

    @thdxr
    Member

    unpublished the broken version will be fixed in 0.3.90 - sorry for that will have to manually update

  2. lucaschallamel commented on Jul 31, 2025

    @lucaschallamel
    Author

    Thanks for the prompt answer, running 0.3.86 for now, keep up the good job!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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