Skip to content

[Bug] TypeError: undefined is not an object (evaluating 'auth.type') #52

@randomm

Description

@randomm

Problem

Runtime error when accessing auth.type on undefined auth object:

TypeError: undefined is not an object (evaluating 'auth.type')

This error appears repeatedly in the TUI, blocking normal operation.

Root Cause

Code is accessing auth.type without first checking if auth is defined. This is different from issue #37 (race condition) - this is a simple null check missing.

Reproduction

  1. Start opencode TUI
  2. Error appears in output

Fix Required

Add null/undefined checks before accessing auth.type:

// Before (broken)
if (auth.type === "something")

// After (safe)
if (auth?.type === "something")

Files to Check

  • packages/opencode/src/auth/
  • packages/opencode/src/provider/
  • Any code that reads auth configuration

Priority

Critical - Blocks normal TUI operation

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions