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

Closed
opened 2026-02-16 17:30:17 -05:00 by yindo · 9 comments
Owner

Originally created by @fmhall on GitHub (Aug 13, 2025).

Originally assigned to: @rekram1-node on GitHub.

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'
Originally created by @fmhall on GitHub (Aug 13, 2025). Originally assigned to: @rekram1-node on GitHub. This is related to #1579, which was prematurely closed by the author. ## How to reproduce <img width="793" height="707" alt="Image" src="https://github.com/user-attachments/assets/fd5d4d41-3b16-4668-8b6e-ddec3cba7646" /> ## 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](https://github.com/sst/opencode/pull/1609) 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' ```
yindo closed this issue 2026-02-16 17:30:17 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Aug 13, 2025):

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

  • #1579: Cannot find module '@opencode-ai/sdk' on clean repo clone when running bun run packages/opencode/src/index after bun install

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.

@github-actions[bot] commented on GitHub (Aug 13, 2025): 👋 This issue might be a duplicate of existing issues. Please check: - #1579: Cannot find module '@opencode-ai/sdk' on clean repo clone when running bun run packages/opencode/src/index after bun install 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.
Author
Owner

@rekram1-node commented on GitHub (Aug 13, 2025):

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

Image
@rekram1-node commented on GitHub (Aug 13, 2025): @fmhall I cannot replicate this, is it perhaps something specific to your environment? <img width="702" height="530" alt="Image" src="https://github.com/user-attachments/assets/863e39f6-588b-46fe-84ef-9ca0b1ef6312" />
Author
Owner

@fmhall commented on GitHub (Aug 13, 2025):

@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.

@fmhall commented on GitHub (Aug 13, 2025): > [@fmhall](https://github.com/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.
Author
Owner

@rekram1-node commented on GitHub (Aug 13, 2025):

@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

@rekram1-node commented on GitHub (Aug 13, 2025): @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
Author
Owner

@rekram1-node commented on GitHub (Aug 14, 2025):

@fmhall did you ever get this figured out?

@rekram1-node commented on GitHub (Aug 14, 2025): @fmhall did you ever get this figured out?
Author
Owner

@Rhain commented on GitHub (Aug 14, 2025):

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

@Rhain commented on GitHub (Aug 14, 2025): 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`
Author
Owner

@rekram1-node commented on GitHub (Aug 16, 2025):

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

@rekram1-node commented on GitHub (Aug 16, 2025): closing as I cannot replicate, haven't seen many people mentioning this. If the issue persists lmk
Author
Owner

@fmhall commented on GitHub (Aug 27, 2025):

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 !

@fmhall commented on GitHub (Aug 27, 2025): 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 !
Author
Owner

@fmhall commented on GitHub (Aug 27, 2025):

I think this fixed it: https://github.com/sst/opencode/commit/9a3186317b010ec03b1680ae9249d90ea6f94356

@fmhall commented on GitHub (Aug 27, 2025): I think this fixed it: https://github.com/sst/opencode/commit/9a3186317b010ec03b1680ae9249d90ea6f94356
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#1284