Skip to content

Local development flow not working due to new plugin logic #1898

Closed

Description

@fmhall

This is related to #1579, which was prematurely closed by the author.

How to reproduce

Image

Discussion

This is likely due to the new plugin logic in packages/opencode/src/plugin/index.ts importing the @opencode-ai/sdk, which does not resolve without first being built.

Ideal solution addresses the root cause of the issue through better dependency resolution or changed logic in plugin/index.ts.

(I created a draft PR last week which fixed the issue in a roundabout way, not recommended to implement)

Error text for indexing:

error: Cannot find module '@opencode-ai/sdk' from '/Users/masonhall/personal/projects/opencode/packages/opencode/src/plugin/index.ts'

Activity

  1. github-actions commented on Aug 13, 2025

    @github-actions
    Contributor

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

    Both issues describe the exact same error: Cannot find module '@opencode-ai/sdk' from '/[path]/packages/opencode/src/plugin/index.ts' when trying to run the local development environment. Issue #1579 specifically mentions the same problem occurs after running bun install and bun run packages/opencode/src/index on a clean repo clone.

    If this doesn't address your specific case, please let us know how this issue differs from the previous report.

  2. rekram1-node commented on Aug 13, 2025

    @rekram1-node
    Contributor

    @fmhall I cannot replicate this, is it perhaps something specific to your environment?

    Image
  3. fmhall commented on Aug 13, 2025

    @fmhall
    Author

    @fmhall I cannot replicate this, is it perhaps something specific to your environment?

    That is so strange.

    I'm on a standard Mac M4 max.
    bun version: v1.2.20
    node version: v24.5.0
    npm version: v11.5.2

    Anything else I should be checking?

    From the other issue (#1579), it looks like other people are having this issue as well.

  4. rekram1-node commented on Aug 13, 2025

    @rekram1-node
    Contributor

    @fmhall I have no idea idk if this helps but here is my setup:

    node --version
    v22.13.0
    
    bun --version
    1.2.19
    
    npm --version
    11.1.0
    

    I am on Mac M3

  5. rekram1-node commented on Aug 14, 2025

    @rekram1-node
    Contributor

    @fmhall did you ever get this figured out?

  6. Rhain commented on Aug 15, 2025

    @Rhain

    Try using an absolute path—it worked for me after I specified the absolute path.

    bun run --conditions=development /Users/rhain/xxxx/opencode/packages/opencode/src/index.ts serve --print-logs

  7. self-assigned this
    on Aug 15, 2025
  8. rekram1-node commented on Aug 16, 2025

    @rekram1-node
    Contributor

    closing as I cannot replicate, haven't seen many people mentioning this. If the issue persists lmk

  9. fmhall commented on Aug 27, 2025

    @fmhall
    Author

    Somehow it's working for me now, I'm using an older version of node, but not sure that was it. Thank you @rekram1-node !

  10. fmhall commented on Aug 28, 2025

    @fmhall
    Author

    I think this fixed it: 9a31863

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