anomalyco / anomalyco/opencode

[BUG] 「V2 (next-17444)」local .ts plugins fail to load on Windows

Open
#42,763 1 comment 0 reactions 1 assignee View on GitHub

@Hona is already working on this.

Since Aug 15, 2026.

2.0
Dominant language
TypeScript
Stars
209k
Forks
27.5k
PR merge metrics
PR metrics pending

Description

Description

A local plugin at ~/.config/opencode/plugins/rtk.ts (also referenced as "./plugins/rtk.ts" in global config) fails to load.

Server log:

  msg="loading plugin" entrypoint="C:/Users/Me0wo/.config/opencode/plugins/rtk.ts?mtime=1786781760442"
  message="failed to load plugin" cause="Die(ResolveMessage: Cannot find module 'C:\Users\Me0wo\.config\opencode\plugins\rtk.ts?mtime=1786781760442' from '')"

/api/plugin shows only internal opencode.* plugins; no user plugin loads.

The supervisor (packages/core/src/plugin/supervisor.ts) imports local files as <abs-path>?mtime=<int> (mtime is always defined so the file:// entrypoint branch is never taken). Standalone bun on the same machine resolves that specifier fine, but the compiled opencode2 binary fails with "Cannot find module ... from ''" looks like the same compiled-binary + query-specifier issue class as #41891, but for core plugin loading and with integer mtimes.

macOS/Linux unaffected.

Plugins

rtk

OpenCode version

V2 (next-17444)

Steps to reproduce

Put any valid V2 plugin .ts (default export = Plugin.define) in ~/.config/opencode/plugins/, watch the server log.

Screenshot and/or share link

No response

Operating System

Windows 11

Terminal

Windows Terminal

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.