Graphify OpenCode plugin fails to load on OpenCode v2: Plugin must export a default definition
On macOS with OpenCode 2.0.4 and graphify 0.9.61 installed via uv,
graphify opencode installgenerates.opencode/plugins/graphify.js, which fails to load at startup on OpenCode 2 with:failed to load plugin ... Plugin must export a default definition with an id and an effect or setup function. The v1 plugin API no longer works on OpenCode 2. Is there a supported v2 plugin or a workaround?Originally asked on GitHub: https://github.com/Graphify-Labs/graphify/issues/3554
5 answers
Fixed in graphify 0.9.84 on PyPI (2026-10-10). On OpenCode 2,
graphify opencode installpreviously generated a v1-style plugin into.opencode/pluginsthat failed to load with:failed to load plugin ... Plugin must export a default definition with an id and an effect or setup function. The fix, from PR #4039, makes the plugin a default export with asetup()hook for OpenCode 2 while keeping the v1server()hook for older OpenCode, andgraphify installnow refreshes an already-installed v1-only copy.Before the fix, one user on OpenCode 2.0.4 (macOS, graphify 0.9.61 via uv) got it loading by replacing the generated file with:
jsexport default { id: "graphify-hook", setup: async ({ tool }) => { tool.hook("execute.before", async (event) => { // same reminder logic as the v1 plugin }); }, };That version loaded and showed up in
plugin list, but the user could not confirmexecute.beforeactually fires at runtime — onlytool.hook("execute.after")was found in the 2.0.4 binary. Another user skipped the plugin entirely and relied onAGENTS.mdandskillsfiles, since the plugin only prints a reminder to rungraphify queryinstead of grepping raw files.Note the folder difference: OpenCode v2 reads
.opencode/plugins(plural); v1 reads.opencode/plugin. Both can be installed side-by-side, and OpenCode 1.18.29+ / v2 also support dual-entrypoint plugins from one package.Did this work for you?What @safishamsi tried on GitHub (Worked)
Upgrade to graphify 0.9.84 from PyPI; the OpenCode plugin now ships with a default export and
setup()hook for OpenCode 2 while keeping the v1server()hook, andgraphify installrefreshes an outdated installed copy.Source: https://github.com/Graphify-Labs/graphify/issues/3554#issuecomment-6091886378 (opens external site)
Did this work for you?What @yukoba tried on GitHub (Worked)
Skip the OpenCode plugin entirely and rely on AGENTS.md and skills files; the plugin only prints a reminder message, so the tool works without it.
Source: https://github.com/Graphify-Labs/graphify/issues/3554#issuecomment-5749120215 (opens external site)
Did this work for you?What @CBEPX tried on GitHub (Partly worked)
Replaced
.opencode/plugins/graphify.jswith a v2-API default export usingtool.hook("execute.before"); it loads and appears inplugin list, but runtime firing was not fully verified.Source: https://github.com/Graphify-Labs/graphify/issues/3554#issuecomment-5696296706 (opens external site)
Did this work for you?What a GitHub user tried on GitHub (Outcome unclear)
Install the v2 plugin in
.opencode/plugins(plural) alongside the v1 plugin in.opencode/plugin, or use a dual-entrypoint plugin package on OpenCode 1.18.29+ / v2; the migration path is described but not verified in the thread.Source: https://github.com/Graphify-Labs/graphify/issues/3554 (opens external site)
Did this work for you?
Related questions
- Does graphify support Antigravity as a client?
- Does graphify support local PDF parsing without the LLM API?
- Graphify manifest.json absolute path keys — how do I share graphify-out?
- Is `graphify` (one y) a PyPI typosquat? Should I install `graphifyy` instead?
- Does graphify support GDScript (.gd) files in Godot 4.x projects?