Skip to content

fix: namespace-import js-yaml for ESM runtime compatibility - #30

Closed
Ghilteras wants to merge 1 commit into
joshuadavidthomas:mainfrom
Ghilteras:fix/js-yaml-esm-import
Closed

fix: namespace-import js-yaml for ESM runtime compatibility#30
Ghilteras wants to merge 1 commit into
joshuadavidthomas:mainfrom
Ghilteras:fix/js-yaml-esm-import

Conversation

@Ghilteras

Copy link
Copy Markdown

Problem: OpenCode loads plugin source in an ESM context where js-yaml’s CJS default export is not synthesized, so the default import breaks at runtime in OpenCode’s bundled runtime.
Fix: use a namespace import, which works under both interop modes.
Scope: three source files (frontmatter.ts, journal.ts, memory.ts), with zero behavior change.
Verification: bun test and bun run typecheck pass.
This fix ships in the maintained fork @ghilteras/opencode-agent-memory since v0.4.1.

@Ghilteras Ghilteras closed this Sep 5, 2026
@Ghilteras
Ghilteras deleted the fix/js-yaml-esm-import branch September 5, 2026 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant