Skip to content

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

Closed as not planned
Closed as not planned

Description

@korade-krushna

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

Activity

  1. github-actions commented on Dec 20, 2025

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    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.

  2. rekram1-node commented on Dec 20, 2025

    @rekram1-node
    Contributor

    can u do

    opencode run hello --print-logs

  3. korade-krushna commented on Dec 20, 2025

    @korade-krushna
    Author

    I'm running this in source code repo of opencode

    bun install
    bun dev

    I have not install opencode yet

  4. shekohex commented on Dec 21, 2025

    @shekohex
    Contributor
  5. rakibdev commented on Dec 21, 2025

    @rakibdev

    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

  6. miouluo commented on Feb 11, 2026

    @miouluo

    好的,找到了问题所在。我在下载中设置了Opencode点文件。例如,它在 symlink dir 里与 i bun 安装关联,而不是 dotfiles dir。因此工具导入无法解析~/Downloads/opencode/tool/webfetch.ts``~/.config/opencode/...``node_modules``webfetch.ts``opencode-ai/plugin

    rm /.config/opencode
    export OPENCODE_CONFIG_DIR=
    /Downloads/opencode
    opencode serve --hostname 0.0.0.0 --port 4096

  7. matthieu-vergne commented on Apr 6, 2026

    @matthieu-vergne

    I have the issue when having the complete tools folder being a symlink:

    • create a folder path/to/tools with a tool foo.ts
    • make a symlink to this folder in ~/.config/opencode

    When running opencode web and requesting to call the tool, it says:
    Cannot find module '@opencode-ai/plugin' from 'path/to/tools/foo.ts'

    opencode v1.3.14 (displayed on the web interface, although opencode upgrade tells me I already have 1.3.15 installed).

  8. removed
    bugSomething isn't working
    on May 3, 2026
  9. github-actions commented on Jul 3, 2026

    @github-actions
    Contributor

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

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

Metadata

Metadata

Assignees

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