Skip to content

fix(opencode): ESM compatibility in bin launcher (#280) - #281

Draft
aarontrowbridge wants to merge 1 commit into
local/amicodefrom
fix-esm-require-launcher
Draft

fix(opencode): ESM compatibility in bin launcher (#280)#281
aarontrowbridge wants to merge 1 commit into
local/amicodefrom
fix-esm-require-launcher

Conversation

@aarontrowbridge

Copy link
Copy Markdown
Member

Fixes #280 — replaces bare require() calls in packages/opencode/bin/opencode with ESM imports (node:child_process, node:fs, node:path, node:os, fileURLToPath for __filename). Fixes ReferenceError: require is not defined under "type": "module". Verified: node --check passes; opencode --version prints 1.18.25. Part of #280.

Replace bare require() calls with ESM imports: node:child_process,
node:fs, node:path, node:os, and fileURLToPath for __filename.
Fixes ReferenceError: require is not defined on first run under
"type": "module". Verified: node --check passes, opencode --version
prints 1.18.25.
@aarontrowbridge aarontrowbridge added the bug Something isn't working label Sep 2, 2026
@coderabbitai

coderabbitai Bot commented Sep 2, 2026

Copy link
Copy Markdown

Important

Draft PR not reviewed

Draft PRs are not automatically reviewed by default.

  • Trigger a manual review

To automatically review draft PRs, update your CodeRabbit configuration:

reviews:
  auto_review:
    drafts: true

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

opencode launcher crashes on first run: ReferenceError: require is not defined in ESM module scope

1 participant