Skip to content

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

Closed

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

Activity

  1. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Feb 13, 2026
  2. github-actions commented on Feb 13, 2026

    @github-actions
    Contributor

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

  3. ariane-emory commented on Feb 13, 2026

    @ariane-emory
    Contributor

    I've observed this myself a few times and did find it it to be irritating, but haven't yet taken a deeper look. I'll try to do so shortly.

  4. added 2 commits that reference this issue on Feb 13, 2026
    246b0d8
    66b1196
  5. ariane-emory commented on Feb 17, 2026

    @ariane-emory
    Contributor

    @rekram1-node I've been playing with a couple of different approaches towards tackling this issue, but I'm currently undecided on which approach I should go with. Which reaction do you think would be preferable if a bad (syntax errors, other loading errors, or just plain missing) plugin is in the configuration line?

    1. Fatal error, refuse to start with an error message.
    2. Nonfatal error, start but display a toast complaining about the bad plugin(s).
  6. github-actions commented on Apr 19, 2026

    @github-actions
    Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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