opencode icon indicating copy to clipboard operation
opencode copied to clipboard

error: Cannot find module '@opencode-ai/plugin' from

Open korade-krushna opened this issue 4 weeks ago • 5 comments

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

korade-krushna avatar Dec 20 '25 20:12 korade-krushna

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.

github-actions[bot] avatar Dec 20 '25 20:12 github-actions[bot]

can u do

opencode run hello --print-logs

rekram1-node avatar Dec 20 '25 20:12 rekram1-node

I'm running this in source code repo of opencode

bun install bun dev

I have not install opencode yet

korade-krushna avatar Dec 20 '25 20:12 korade-krushna

Maybe related? https://github.com/shekohex/opencode-google-antigravity-auth/issues/5

shekohex avatar Dec 21 '25 10:12 shekohex

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

rakibdev avatar Dec 21 '25 17:12 rakibdev