Skip to content

Plugin deduplication incorrectly removes plugins with index.js entry points #11159

Closed as not planned

Description

@guazi04

Description

Bug Description
When multiple plugins have entry points named index.js or index.ts, only the last one is loaded. Earlier plugins are silently removed.
Root Cause
getPluginName() returns only the filename for file:// URLs. Since most plugins use index.js/index.ts as entry points, they all return "index" and get deduplicated.
Reproduction
Config with two plugins:
"plugin": ["oh-my-opencode", "file:///path/to/my-plugin/src/index.ts"]
Result: oh-my-opencode is removed because both resolve to name "index".
Environment

  • OpenCode v1.1.42
  • Windows 11

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 Jan 29, 2026

    @github-actions
    Contributor

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

    These issues all describe the same root cause: plugin deduplication logic that doesn't properly account for multiple local plugins or plugins with identical entry point filenames.

    Feel free to ignore if your specific case differs from these.

  2. cyberprophet commented on Mar 4, 2026

    @cyberprophet
    Contributor

    This is addressed by #15598 which adds node_modules-aware path parsing to getPluginName(). CI is green.

    The root cause is that import.meta.resolve resolves npm plugins to file://…/node_modules/<pkg>/dist/index.js, and then getPluginName() extracts only the filename "index", causing false collisions with any project plugin that also has an index.ts entry point.

    Related issues: #8759, #10115, #11159, #12285, #14304, #15591

  3. added a commit that references this issue on Apr 8, 2026
    b3f356e
  4. 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