Summary
@morphllm/opencode-morph-plugin@2.0.9 fails to load in opencode 1.3.17.
This does not look like a single missing export. It appears to be a runtime compatibility problem between the plugin / @morphllm/morphsdk and opencode's plugin loader, likely around ESM/CJS interop.
Environment
- OS: Windows 11
- opencode: 1.3.17
- plugin:
@morphllm/opencode-morph-plugin@2.0.9
- install path: loaded as an opencode plugin from
.config/opencode/opencode.json
Reproduction
- Add the plugin to
opencode.json:
{
"plugin": [
"@morphllm/opencode-morph-plugin"
],
"instructions": [
"node_modules/@morphllm/opencode-morph-plugin/instructions/morph-tools.md"
]
}
- Run:
opencode debug config --print-logs --log-level DEBUG
- opencode fails while loading the plugin.
Errors observed
I consistently reproduced these loader errors while debugging:
Export named 'rgPath' not found in module '...@vscode\\ripgrep\\lib\\index.js'
Export named 'getVercelOidcToken' not found in module '...@vercel\\oidc\\dist\\index.js'
I also tried locally patching the plugin to route around the ESM entrypoint and use the CJS build of morphsdk, but opencode's loader then surfaced this:
require() async module '...@morphllm\\morphsdk\\dist\\index.cjs' is unsupported. use "await import()" instead.
When forcing await import() against index.cjs, opencode's runtime appeared to return an empty namespace object for that module, which then led to:
undefined is not a constructor (evaluating 'new MorphClient(...)')
Notes
- The same plugin/module shape was testable separately under plain
bun, so this seems specific to opencode's plugin runtime/loader behavior.
- Because of the chained failures, this may need a compatibility pass in the plugin build output rather than a one-line fix.
If useful, I can provide the full opencode debug config --print-logs --log-level DEBUG output.
Summary
@morphllm/opencode-morph-plugin@2.0.9fails to load inopencode 1.3.17.This does not look like a single missing export. It appears to be a runtime compatibility problem between the plugin /
@morphllm/morphsdkand opencode's plugin loader, likely around ESM/CJS interop.Environment
@morphllm/opencode-morph-plugin@2.0.9.config/opencode/opencode.jsonReproduction
opencode.json:{ "plugin": [ "@morphllm/opencode-morph-plugin" ], "instructions": [ "node_modules/@morphllm/opencode-morph-plugin/instructions/morph-tools.md" ] }Errors observed
I consistently reproduced these loader errors while debugging:
I also tried locally patching the plugin to route around the ESM entrypoint and use the CJS build of
morphsdk, but opencode's loader then surfaced this:When forcing
await import()againstindex.cjs, opencode's runtime appeared to return an empty namespace object for that module, which then led to:Notes
bun, so this seems specific to opencode's plugin runtime/loader behavior.If useful, I can provide the full
opencode debug config --print-logs --log-level DEBUGoutput.