Skip to content

do not crash on bad user config, or if we must at least provide better feedback #4145

Closed as duplicate

Description

@ferdinandyb

Description

I messed up the structure of my config with non-existent keys, and opencode died with this extremely helpful message:


 [ERROR] Error: undefined is not an object (evaluating 'x3.data.providers')                    │After this operation, 1736 kB disk space will be freed.
     TypeError: undefined is not an object (evaluating 'x3.data.providers')                               │Do you want to continue? [Y/n] y
         at <anonymous> (src/cli/cmd/tui/context/sync.tsx:148:81)                                         │(Reading database ... 129950 files and directories currently installed.)
         at processTicksAndRejections (native:7:39)                                                       │Removing certbot (2.9.0-1) ...
 [21:56:12] [ERROR] Error: undefined is not an object (evaluating 'x3.data.providers')                    │Removing python3-certbot (2.9.0-1) ...
     TypeError: undefined is not an object (evaluating 'x3.data.providers')                               │Processing triggers for man-db (2.12.0-4build2) ...
         at <anonymous> (src/cli/cmd/tui/context/sync.tsx:148:81)                                         │
        at processTicksAndRejections (native:7:39)

It should definitely tell me that my config is bad, better yet, tell me what it does not like.

OpenCode version

1.0.51

Steps to reproduce

Mess up your config with a non-existent key.

Screenshot and/or share link

No response

Operating System

linux

Terminal

No response

Activity

  1. added
    opentuiThis relates to changes in v1.0, now that opencode uses opentui
    on Nov 9, 2025
  2. github-actions commented on Nov 9, 2025

    @github-actions
    Contributor

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

    Feel free to ignore if none of these address your specific case.

  3. veracioux commented on Nov 9, 2025

    @veracioux
    Contributor

    I have a PR in the works for this: #4058.

    It will surface errors better to the user without crashing like this. Although, since the error in this specific issue is regarding the configuration, the app should probably exit immediately (*), informing the user of the issue. This is because virtually anything useful in the TUI depends on the user's configuration.

    (*) I'm currently working on this.

  4. ferdinandyb commented on Nov 9, 2025

    @ferdinandyb
    ContributorAuthor

    exit immediately is a much better idea yes!

  5. taqtiqa-mark commented on Nov 10, 2025

    @taqtiqa-mark

    @ferdinandyb and @veracioux this is a duplicate of #3868. Can you close this and discuss there?

    If not... given OC is still being developed please try to "stay in the game" rather than exiting immediately. Robust startup is discussed, here #3537 (comment)

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingopentuiThis 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