Skip to content

Fix Windows ESM loader protocol issue in CLI#135

Merged
athal7 merged 1 commit into
mainfrom
jules-4380419992592494834-99065e43
Jul 17, 2026
Merged

Fix Windows ESM loader protocol issue in CLI#135
athal7 merged 1 commit into
mainfrom
jules-4380419992592494834-99065e43

Conversation

@athal7

@athal7 athal7 commented Jul 16, 2026

Copy link
Copy Markdown
Owner

This PR fixes an ESM loader protocol issue encountered on Windows machines. Specifically, when starting or running CLI commands, Node.js throws an error because dynamic dynamic imports (import()) with absolute filesystem paths (like C:\...) are treated as having a c: protocol. We resolve this by converting the absolute paths into valid file:// URLs using pathToFileURL(absolutePath).href before passing them to the dynamic import() call.

Fixes #118


PR created automatically by Jules for task 4380419992592494834 started by @athal7

Summary by CodeRabbit

  • Bug Fixes
    • Improved CLI compatibility when dynamically loading local modules.
    • Fixed module resolution for service, version, repository configuration, and polling components.

On Windows, Node.js ESM loader expects absolute file paths to be valid
file:// URLs, otherwise it throws a protocol error (e.g., 'Received protocol c:').
This change converts all dynamically imported absolute filesystem paths in the
CLI to valid file:// URLs using node's built-in `pathToFileURL`.

Co-authored-by: athal7 <467872+athal7@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: cd8f7a2b-3826-4415-8080-029de7de2b00

📥 Commits

Reviewing files that changed from the base of the PR and between 091b6e1 and b609276.

📒 Files selected for processing (1)
  • bin/opencode-pilot

📝 Walkthrough

Walkthrough

The CLI now converts local filesystem paths to file:// URLs before dynamically importing server, version, repository configuration, and poller modules.

Changes

ESM import URL handling

Layer / File(s) Summary
Convert CLI dynamic imports to file URLs
bin/opencode-pilot
Adds pathToFileURL and applies it to dynamic imports across the CLI commands.

Estimated code review effort: 1 (Trivial) | ~5 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly matches the main change: fixing the Windows ESM loader protocol issue in the CLI.
Linked Issues check ✅ Passed The PR addresses #118 by converting local dynamic imports to file:// URLs, which resolves the Windows c: protocol loader error.
Out of Scope Changes check ✅ Passed The changes are narrowly scoped to ESM import path handling and do not introduce unrelated behavior.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch jules-4380419992592494834-99065e43

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

@athal7 athal7 self-assigned this Jul 17, 2026
@athal7
athal7 merged commit 9bd3067 into main Jul 17, 2026
3 checks passed
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.

ESM loader issue with fresh install

1 participant