GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [Bug][Web] Basic auth causes 401 on /site.webmanifest and /global/event, then crashes with PasteTypeError · Issue #16493 · anomalyco/opencode

[Bug][Web] Basic auth causes 401 on /site.webmanifest and /global/event, then crashes with PasteTypeError #16493

New issue
Copy link
New issue
Copy link
Closed as not planned
Closed as not planned
[Bug][Web] Basic auth causes 401 on /site.webmanifest and /global/event, then crashes with PasteTypeError#16493
Copy link
Assignees
iamdavidhill

Description

@Kevin-HYX
Kevin-HYX
opened on Mar 7, 2026
Issue body actions

Description

When running OpenCode Web with server auth enabled (OPENCODE_SERVER_USERNAME / OPENCODE_SERVER_PASSWORD), the app partially loads, but two requests fail with 401:

  • GET /site.webmanifest -> 401 Unauthorized
  • GET /global/event -> fetch failed / unauthorized

After that, the UI crashes with:

PasteTypeError: Cannot read properties of undefined (reading 'length')

This looks like a web auth inconsistency + missing frontend guard after unauthorized event/manifest fetch.

Plugins

No response

OpenCode version

1.2.20

Steps to reproduce

  1. On Windows, set env vars for web auth:
    • OPENCODE_SERVER_USERNAME=<redacted>
    • OPENCODE_SERVER_PASSWORD=<redacted>
  2. Start web mode: opencode web
  3. Open browser to local URL (e.g. http://127.0.0.1:<port>)
  4. Observe console/network errors and then frontend crash.

Screenshot and/or share link

Console snippets (sanitized):

  • GET http://127.0.0.1:40960/site.webmanifest 401 (Unauthorized)
  • Fetch failed loading: GET "http://127.0.0.1:40960/global/event"
  • PasteTypeError: Cannot read properties of undefined (reading 'length')
    at assets/session-*.js
    at assets/index-*.js

Operating System

Windows

Terminal

PowerShell

Activity

  1. github-actions
    assigned
    iamdavidhill
    on Mar 7, 2026
  2. github-actions
    added
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    webRelates to opencode on web / desktop
    windows
    on Mar 7, 2026
  3. github-actions commented on Mar 7, 2026

    @github-actions
    github-actionsBot
    on Mar 7, 2026 – with GitHub Actions
    Contributor
    More actions

    This issue might be a duplicate of existing issues. Please check:

    • PWA failed because HTTP basic auth block static assets #12447: Basic auth blocks /site.webmanifest (same root cause - static assets not exempted from auth middleware)
    • Web UI: Basic Auth incompatible with crossorigin attributes on assets #9206: Basic auth causes 401 on assets leading to frontend crash (same symptom pattern)
    • Open an opencode url via basic auth will show error stack #15991: Basic auth via URL causes frontend error stack/crash (similar crash behavior)

    If your issue is distinct, please clarify what differs from the above.

  4. thdxr
    removed
    windows
    webRelates to opencode on web / desktop
    coreAnything pertaining to core functionality of the application (opencode server stuff)
    on May 3, 2026
  5. rocordov commented on May 5, 2026

    @rocordov
    rocordov
    on May 5, 2026
    More actions

    Workaround: we found that running a second opencode web instance on a different port (for session isolation) triggers this bug. The manifest 401 is cosmetic but the /global/event 401 crashes the UI with PasteTypeError, making the session page completely blank.

    Our workaround: the secondary server runs without auth (OPENCODE_SERVER_PASSWORD unset) and we don't open its web UI at all. Instead, we proxy session messages through our own API endpoint and display CoT in a custom modal.

    The underlying issue is that the auth middleware doesn't exempt static assets (site.webmanifest, favicon) or the SSE event stream (/global/event). Related to #12447 (closed) and #9206.

  6. rocordov commented on May 5, 2026

    @rocordov
    rocordov
    on May 5, 2026
    More actions

    Workaround implemented: We found that the manifest/event 401 crash is triggered by Basic auth on the OpenCode web server. Our workaround: don't use auth on the isolated server instance (just the main server on 4096). The isolated server is headless — we proxy its session API through our own web.py endpoint and display CoT/chat in a custom modal.

    Root cause appears to be that the auth middleware doesn't exempt static assets (site.webmanifest, favicon) or the SSE event stream (/global/event). Related: #12447 (closed), #9206, #18302.

  7. shoootyou
    added 3 commits that reference this issue on Jun 9, 2026

    feat(server,app): replace Basic Auth dialog with custom login page

    This issue will close once commit d85a5cc is merged into the 'fork-dev-v2' branch.
    d85a5cc
  8. github-actions commented on Jul 5, 2026

    @github-actions
    github-actionsBot
    on Jul 5, 2026 – with GitHub Actions
    Contributor
    More actions

    To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.

  9. github-actions
    closed this as not plannedon Jul 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @iamdavidhill
    iamdavidhill

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.