Skip to content

Plugin syntax/build errors cause black screen with no user-facing error message #13461

@dvir1994

Description

@dvir1994

Description

When a local plugin file has a syntax error (e.g., unterminated string literal), OpenCode renders a completely black/blank screen on startup with no error message or indication of what went wrong.

The error is logged to ~/.local/share/opencode/log/:

ERROR service=default e={"name":"BuildMessage","position":{"lineText":"  hebrew: [Carmit'],",
"file":"...notifications.ts","line":5,"column":18},"message":"Unterminated string literal","level":"error"} exception

...but nothing is shown to the user in the TUI. The only way to diagnose it is to know the log file location and check manually.

Expected: OpenCode should either display an error message in the TUI (e.g., "Failed to load plugin notifications.ts: Unterminated string literal at line 5"), or gracefully skip the broken plugin and continue loading.

Related: #12192 (same black screen symptom from a different plugin), #12931 (plugin runtime errors corrupting TUI — different phase).

Plugins

Custom local plugin at ~/.config/opencode/plugin/notifications.ts (with a syntax error)

OpenCode version

v1.1.65

Steps to reproduce

  1. Create a plugin file at ~/.config/opencode/plugin/example.ts with a syntax error, e.g.:
    import type { Plugin } from "@opencode-ai/plugin";
    const foo = [bar'];  // missing opening quote
    export const ExamplePlugin: Plugin = async ({ client, $ }) => ({});
  2. Launch opencode
  3. Observe: black/blank screen, no error message, fully unusable
  4. Remove the plugin file — OpenCode starts normally again

Screenshot and/or share link

N/A — it's a completely black screen, there's nothing to screenshot

Operating System

macOS (Darwin)

Terminal

Ghostty

Metadata

Metadata

Assignees

Labels

opentuiThis relates to changes in v1.0, now that opencode uses opentui

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions