Skip to content

Uncaught Exception: TypeError: Object has been destroyed (BrowserWindow) in desktop app #35501

Description

@christsx

Description

The desktop app (OpenCode.app on macOS) throws an uncaught exception referencing a destroyed BrowserWindow object. Full stack trace:

Uncaught Exception:
TypeError: Object has been destroyed
at BrowserWindow. (file:///Applications/OpenCode.app/Contents/Resources/app.asar/out/main/index.js:1389:76)
at BrowserWindow.emit (node:events:509:28)
at WebContents. (node:electron/js2c/browser_init:2:18806)
at WebContents.emit (node:events:509:28)
at file:///Applications/OpenCode.app/Contents/Resources/app.asar/out/main/index.js:3468:11
at
at process.processTicksAndRejections (node:internal/process/task_queues:104:5)

This looks like an event listener on a BrowserWindow/WebContents firing after the window has already been destroyed (missing an isDestroyed() guard before accessing the window).

Plugins

No response

OpenCode version

v1.17.13

Steps to reproduce

  1. Open OpenCode Desktop
  2. [action that triggers it, e.g. close a window / quit the app]
  3. Uncaught exception appears in console/logs

Screenshot and/or share link

No response

Operating System

26.2 (25C56)

Terminal

Ghostly

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions