error: Cannot find module '@opencode-ai/plugin' from
Description
Whenever I try to have conversation with opencode this error comes up
error: Cannot find module '@opencode-ai/plugin' from
OpenCode version
running using source code
Steps to reproduce
clone repo bun install bun dev add gemini api key have conversation with opencode
Screenshot and/or share link
No response
Operating System
No response
Terminal
No response
This issue might be a duplicate of existing issues. Please check:
- #1579: Cannot find module '@opencode-ai/sdk' on clean repo clone when running bun run packages/opencode/src/index after bun install
- #1898: Local development flow not working due to new plugin logic
Both issues describe the same root cause: module resolution errors with @opencode-ai/* packages during local development setup (clone repo → bun install → bun dev). The issue appears to be related to plugin logic in packages/opencode/src/plugin/index.ts importing @opencode-ai/sdk which does not resolve without the SDK being built first.
Feel free to ignore if this is a different scenario from these existing issues.
can u do
opencode run hello --print-logs
I'm running this in source code repo of opencode
bun install bun dev
I have not install opencode yet
Maybe related? https://github.com/shekohex/opencode-google-antigravity-auth/issues/5
ok found the issue.
i've opencode dotfiles in Downloads. e.g., ~/Downloads/opencode/tool/webfetch.ts
which is symlinked to ~/.config/opencode/...
i bun install node_modules in symlink dir not dotfiles dir. for that reason tool webfetch.ts imports couldn't resolve opencode-ai/plugin