Skip to content

[Bug]: Plugin load fails at startup: Cannot find module '@opencode-ai/plugin/tool' #359

@tisDDM

Description

@tisDDM

App Variant

Electron

Operating System & Version

Ubuntu 25.10

Issue Summary

Cloning and building from scratch shows missing module error message

Steps to Reproduce

  1. Clone repo
  2. npm i
  3. npm run dev
  4. See the error message

Expected Behavior

No error msg - opencode-ai plugin loads without error

Logs & Screenshots

No response

Additional Context

I am a notorious let's build it from source guy and observed the above error during startup. A quick analysis with an AI showed the analysis below - and it fixed the behavior. Educated guess: either my environment is lacking an installation or the build environment is deviating from the instructions
What was missing (AI Text following) :

packages/opencode-config/node_modules/ is absent after a fresh clone. Specifically, @opencode-ai/plugin (v1.14.19) is not installed, so the import import { tool } from "@opencode-ai/plugin/tool" in packages/opencode-config/plugin/lib/background-process.ts cannot resolve.

Root cause:
packages/opencode-config/ is not listed in the root package.json workspaces (only server, ui, electron-app, and tauri-app are). Running npm install at the repo root therefore skips its dependencies. The node_modules directory is also in packages/opencode-config/.gitignore, so it's never checked in.

Impact:
When OpenCode spawns and tries to load the codenomad.ts plugin, the entire plugin fails to load. Background process tools (run, list, read, stop, terminate) and plugin events (ping/pong, voice mode) are unavailable.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions