Repository navigation
Bug Report: Cannot find module tree-sitter module on macOS arm64 #1454
Description
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
- 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
- Run any OpenCode command:
opencode --version
# or
opencode --help
# or
opencode auth login
- 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
thdxr commentedon Jul 31, 2025
unpublished the broken version will be fixed in 0.3.90 - sorry for that will have to manually update
lucaschallamel commentedon Jul 31, 2025
Thanks for the prompt answer, running 0.3.86 for now, keep up the good job!