Skip to content

[docs] Plugin package.json example's peer ranges cause ERESOLVE #58807

Open

Description

@sechlol

Description

Environment


1. The example declares peer ranges that cannot install

The docs' package.json example says:

"peerDependencies": {
  "@opentui/core": ">=0.6.6",
  "@opentui/solid": ">=0.6.6",
  "solid-js": ">=1.9.0"
}

but @opencode/[email protected] itself declares:

"peerDependencies": {
  "solid-js": ">=1.9.0",
  "@opentui/core": ">=0.6.8",
  "@opentui/solid": ">=0.6.8",
  "@opencode/theme": "2.1.4"
}

Following the docs and pinning any @opentui/* version in [0.6.6, 0.6.8) — which the docs'
range explicitly allows — hard-fails npm resolution:

$ npm install
npm error While resolving: @opencode/[email protected]
npm error Found: @opentui/[email protected]
npm error Could not resolve dependency:
npm error peerOptional @opentui/core@">=0.6.8" from @opencode/[email protected]
npm error Conflicting peer dependency: @opentui/[email protected]
npm error Fix the upstream dependency conflict, or retry this command with --force or --legacy-peer-deps

Reproduction: a minimal package with dependencies: { "@opencode/plugin": "2.1.4" } and the
docs' peerDependencies verbatim, then npm install @opentui/[email protected]. With no explicit
pin the install happens to succeed (npm picks 0.6.8), which makes the bad range easy to miss
until a consumer pins a version — by which point they hit a confusing ERESOLVE pointing at
@opencode/plugin's peer, not at the docs.

Suggested fix: use >=0.6.8 (or simply mirror @opencode/plugin's own peer ranges), and
add the missing "@opencode/theme" peer the package declares.


2. Minor gaps in the same docs (docs-only; behavior is tracked elsewhere)

  • /v2/docs/plugins says a configured local path loads "the directory's server or index
    module" but never says what happens when there is neither: on 2.1.4 the directory is
    silently skipped (no log line, no warning), and package.json main/exports are not
    consulted for config-path directories. The behavior itself is already tracked in
    #52300 and #58574 (also #46551) — this is only a docs request:
    state the required layout (index.ts/server.ts at the directory root) and that a missing
    entrypoint is dropped silently until plugins: local plugin directory ignores package.json main and is silently skipped without a root entrypoint #52300 lands.
  • The discovery examples show only tui.ts, but tui.tsx works identically (verified on
    2.1.4); both spellings appear in the wild, so mentioning both would save authors a guess.

Plugins

No response

OpenCode version

2.1.4

Steps to reproduce

No response

Screenshot

No response

Operating System

macOS 27.0.1

Terminal

iTerm2

Activity

  1. opencode-agent commented on Oct 24, 2026

    @opencode-agent
    Contributor

    Thanks for the detailed report. I can confirm this. With @opencode/[email protected] as a dependency and the docs' peerDependencies copied exactly, npm install @opentui/[email protected] fails with the ERESOLVE you quoted (Conflicting peer dependency: @opentui/[email protected] … peerOptional @opentui/core@">=0.6.8" from @opencode/[email protected]). The script below reproduces it.

    It's still the same on the latest dev (13a615b). The "Publish and load" example still says >=0.6.6 and still has no @opencode/theme peer, while @opencode/plugin requires >=0.6.8. The minimum was probably raised in the OpenTUI 0.6.8 upgrade (#58380), and the docs example wasn't updated with it.

    Your other two points are also noted:

    Reproduction script (repro.sh)
    #!/usr/bin/env bash
    # Reproduces #58807: the docs' plugin package.json peer ranges allow @opentui/* 0.6.6,
    # but @opencode/[email protected] requires >=0.6.8, so pinning 0.6.6 fails with ERESOLVE.
    set -u
    VERSION="${1:-2.1.4}"
    DIR=$(mktemp -d)
    cd "$DIR"
    cat > package.json <<JSON
    {
      "name": "opencode-acme-plugin",
      "type": "module",
      "exports": { ".": "./src/index.ts", "./tui": "./src/tui.tsx" },
      "dependencies": { "@opencode/plugin": "$VERSION" },
      "peerDependencies": {
        "@opentui/core": ">=0.6.6",
        "@opentui/solid": ">=0.6.6",
        "solid-js": ">=1.9.0"
      }
    }
    JSON
    echo "--- @opencode/plugin@$VERSION peerDependencies:"
    npm view "@opencode/plugin@$VERSION" peerDependencies
    echo "--- npm install @opentui/[email protected] (allowed by the docs' range):"
    npm install --no-audit --no-fund @opentui/[email protected] 2>&1 | tail -15
    echo "exit: ${PIPESTATUS[0]}"

    Run it: bash repro.sh

  2. renjianguojinqianfan commented on Oct 25, 2026

    @renjianguojinqianfan

    I'd like to take this one. Preparing a docs PR that aligns the peer ranges with what @opencode/plugin declares (>=0.6.8, plus the missing @opencode/theme peer), mentions tui.tsx alongside tui.ts, and states that a configured directory without a root index or server module is skipped without a warning.

  3. added 2 commits that reference this issue on Oct 25, 2026
    161b388
    020b05f
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions