-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Description
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
- Create a plugin file at
~/.config/opencode/plugin/example.tswith a syntax error, e.g.:import type { Plugin } from "@opencode-ai/plugin"; const foo = [bar']; // missing opening quote export const ExamplePlugin: Plugin = async ({ client, $ }) => ({});
- Launch
opencode - Observe: black/blank screen, no error message, fully unusable
- 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