Skip to content

Electron sidecar: npm plugins fail to load — peer dep @opencode-ai/plugin resolves as @local #26085

Closed as not planned

Description

@n-osennij

Description

Description

After updating OpenCode Desktop to Electron-based version 1.14.39, npm plugins fail to load. The sidecar's background dependency installer resolves the host-provided package @opencode-ai/plugin as @opencode-ai/plugin@local and fails because that version doesn't exist on npm.

Steps to reproduce

  1. Fresh opencode config with any npm plugin that has @opencode-ai/plugin as a peer dependency:
// ~/.config/opencode/opencode.json
{
  "$schema": "https://opencode.ai/config.json",
  "plugin": ["@tarquinen/opencode-dcp"]
}
  1. Restart OpenCode Desktop
  2. Check ~/.local/share/opencode/log/

Actual behavior

Plugin fails to load with two cascade errors:

WARN service=config dir=~/.config/opencode
  error=Cause([Fail(NpmInstallFailedError
    (cause: @opencode-ai/plugin: No matching version found for @opencode-ai/plugin@local.))])
  background dependency install failed

ERROR service=plugin path=@tarquinen/opencode-dcp
  target=file:///.../packages/@tarquinen/opencode-dcp@latest/node_modules/.../dist/index.js
  error=Cannot find module '.../dist/lib/config' imported from ...dist/index.js
  failed to load plugin

Expected behavior

@opencode-ai/plugin is provided by the opencode host (it's a peer dependency of plugins). The sidecar should NOT attempt to install it from npm — it should be treated as an external/host-provided module during dependency resolution.

Root cause analysis

  1. The sidecar's dependency installer walks the plugin's dependency tree
  2. It encounters @opencode-ai/plugin (peerDependency: >=1.2.0)
  3. Instead of treating it as a host-provided external, it resolves it as @opencode-ai/plugin@local
  4. @opencode-ai/plugin@local doesn't exist as an npm dist-tag → install fails
  5. Without its dependencies installed, the plugin's internal imports (dist/lib/config, etc.) also fail

The same NpmInstallFailedError appears for both config directories (~/.config/opencode and ~/.opencode), suggesting it's a systemic resolution issue.

Additional note

The plugin is resolved to packages/@tarquinen/opencode-dcp@latest/ — the @latest suffix is added by the sidecar even when not specified in config.

Environment

  • OpenCode Desktop: 1.14.39 (Electron)
  • OS: macOS 15.7.2 (arm64)
  • Bun: 1.3.13
  • Node: 22.22.2
  • Plugin: @tarquinen/[email protected] (peerDep: @opencode-ai/plugin >=1.2.0)
    ISSUE

Title: Electron sidecar: npm plugins fail to load — peer dep @opencode-ai/plugin resolves as @Local

Description

After updating OpenCode Desktop to Electron-based version 1.14.39, npm plugins fail to load. The sidecar's background dependency installer resolves the host-provided package @opencode-ai/plugin as @opencode-ai/plugin@local and fails because that version doesn't exist on npm.

Steps to reproduce

  1. Fresh opencode config with any npm plugin that has @opencode-ai/plugin as a peer dependency:
// ~/.config/opencode/opencode.json
{
  "$schema": "https://opencode.ai/config.json",
  "plugin": ["@tarquinen/opencode-dcp"]
}
  1. Restart OpenCode Desktop
  2. Check ~/.local/share/opencode/log/

Actual behavior

Plugin fails to load with two cascade errors:

WARN service=config dir=~/.config/opencode
  error=Cause([Fail(NpmInstallFailedError
    (cause: @opencode-ai/plugin: No matching version found for @opencode-ai/plugin@local.))])
  background dependency install failed

ERROR service=plugin path=@tarquinen/opencode-dcp
  target=file:///.../packages/@tarquinen/opencode-dcp@latest/node_modules/.../dist/index.js
  error=Cannot find module '.../dist/lib/config' imported from ...dist/index.js
  failed to load plugin

Expected behavior

@opencode-ai/plugin is provided by the opencode host (it's a peer dependency of plugins). The sidecar should NOT attempt to install it from npm — it should be treated as an external/host-provided module during dependency resolution.

Root cause analysis

  1. The sidecar's dependency installer walks the plugin's dependency tree
  2. It encounters @opencode-ai/plugin (peerDependency: >=1.2.0)
  3. Instead of treating it as a host-provided external, it resolves it as @opencode-ai/plugin@local
  4. @opencode-ai/plugin@local doesn't exist as an npm dist-tag → install fails
  5. Without its dependencies installed, the plugin's internal imports (dist/lib/config, etc.) also fail

The same NpmInstallFailedError appears for both config directories (~/.config/opencode and ~/.opencode), suggesting it's a systemic resolution issue.

Additional note

The plugin is resolved to packages/@tarquinen/opencode-dcp@latest/ — the @latest suffix is added by the sidecar even when not specified in config.

Environment

  • OpenCode Desktop: 1.14.39 (Electron)
  • OS: macOS 15.7.2 (arm64)
  • Bun: 1.3.13
  • Node: 22.22.2
  • Plugin: @tarquinen/[email protected] (peerDep: @opencode-ai/plugin >=1.2.0)

Plugins

No response

OpenCode version

No response

Steps to reproduce

No response

Screenshot and/or share link

No response

Operating System

No response

Terminal

No response

Activity

  1. github-actions commented on May 6, 2026

    @github-actions
    Contributor

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

    • Windows Desktop 1.14.39 tries to install @opencode-ai/plugin@local #26003: Same root cause — Desktop 1.14.39 attempts to install @opencode-ai/plugin@local, which fails because local is not a published npm dist-tag. That issue also includes a detailed root cause analysis pointing to the missing OPENCODE_VERSION define in the Node server build used by the Electron Desktop.
  2. github-actions commented on Jul 8, 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