[Bug]: opencode auth login google fails with 'fetch() URL is invalid' #8996

Open
opened 2026-02-16 18:11:21 -05:00 by yindo · 0 comments
Owner

Originally created by @chindris-mihai-alexandru on GitHub (Feb 10, 2026).

Originally assigned to: @rekram1-node on GitHub.

OpenCode Version: 1.1.53
Platform: macOS Sequoia 15.7.4
Plugin: opencode-gemini-auth@1.3.8

Description

The opencode auth login google command fails with "fetch() URL is invalid" error. This prevents users from authenticating with Google to use Gemini models.

Steps to Reproduce

  1. Run opencode auth login google
  2. Error occurs immediately

Error Message

Unexpected error, check log file at /Users/mihai/.local/share/opencode/log/2026-02-10T173835.log for more details

fetch() URL is invalid

Log Output

ERROR  2026-02-10T17:38:35 +44ms service=default name=TypeError message=fetch() URL is invalid stack=TypeError: fetch() URL is invalid
    at fetch (unknown)
    at fn (src/cli/cmd/auth.ts:232:35)
    at fn (src/cli/cmd/auth.ts:228:18)
    at <anonymous> (src/project/instance.ts:41:45)
    at run (node:async_hooks:62:22)
    at async handler (src/cli/cmd/auth.ts:226:20)
    at processTicksAndRejections (native:7:39) fatal

Additional Context

  • The opencode-gemini-auth plugin loads successfully
  • Existing Google credentials are detected in ~/.local/share/opencode/auth.json
  • The auth command fails before any OAuth flow begins
  • This appears to be a bug in OpenCode's core auth handling, not the plugin

Workarounds

  1. Try using existing credentials directly with model command (may fail if expired)
  2. Use alternative providers like zen/kimi-k2.5-free or cerebras/llama-3.3-70b

Expected Behavior

The opencode auth login google command should initiate the OAuth flow for Google authentication.

Originally created by @chindris-mihai-alexandru on GitHub (Feb 10, 2026). Originally assigned to: @rekram1-node on GitHub. **OpenCode Version:** 1.1.53 **Platform:** macOS Sequoia 15.7.4 **Plugin:** opencode-gemini-auth@1.3.8 ## Description The `opencode auth login google` command fails with "fetch() URL is invalid" error. This prevents users from authenticating with Google to use Gemini models. ## Steps to Reproduce 1. Run `opencode auth login google` 2. Error occurs immediately ## Error Message ``` Unexpected error, check log file at /Users/mihai/.local/share/opencode/log/2026-02-10T173835.log for more details fetch() URL is invalid ``` ## Log Output ``` ERROR 2026-02-10T17:38:35 +44ms service=default name=TypeError message=fetch() URL is invalid stack=TypeError: fetch() URL is invalid at fetch (unknown) at fn (src/cli/cmd/auth.ts:232:35) at fn (src/cli/cmd/auth.ts:228:18) at <anonymous> (src/project/instance.ts:41:45) at run (node:async_hooks:62:22) at async handler (src/cli/cmd/auth.ts:226:20) at processTicksAndRejections (native:7:39) fatal ``` ## Additional Context - The opencode-gemini-auth plugin loads successfully - Existing Google credentials are detected in ~/.local/share/opencode/auth.json - The auth command fails before any OAuth flow begins - This appears to be a bug in OpenCode's core auth handling, not the plugin ## Workarounds 1. Try using existing credentials directly with model command (may fail if expired) 2. Use alternative providers like zen/kimi-k2.5-free or cerebras/llama-3.3-70b ## Expected Behavior The `opencode auth login google` command should initiate the OAuth flow for Google authentication.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#8996