Skip to content

server.root is not a function #1590

Closed

Description

@calebdw

Hello!

I keep getting the following error when opencode tries to use my lsp:

TypeError: server.root is not a function. (In 'server.root(file2, App.info())', 'server.root' is undefined)

Here's my configuration:

{
  "$schema": "https://opencode.ai/config.json",
  "lsp": {
    "phpactor": {
      "command": [
        "~/.local/share/nvim/mason/bin/phpactor",
        "language-server"
      ],
      "extensions": [
        ".php"
      ],
      "initialization": {
        "indexer.follow_symlinks": true,
        "language_server_phpstan.enabled": true
      }
    }
  },
  "model": "anthropic/claude-sonnet-4-20250514",
  "theme": "system"
}

Thanks!

Activity

  1. rafaelcl292 commented on Aug 4, 2025

    @rafaelcl292

    I've run into the same problem with several LSPs.

    {
      "$schema": "https://opencode.ai/config.json",
      "lsp": {
        "typescript": {
          "disabled": true
        },
        "tsserver": {
          "command": [
            "bunx",
            "typescript-language-server",
            "--stdio"
          ],
          "extensions": [
            ".ts"
          ]
        }
      }
    }
    INFO  service=default version=0.3.127 args=["debug","lsp","diagnostics","--print-logs","src/services/auth.service.ts"] opencode
    INFO  service=app cwd=***REDACTED*** creating
    INFO  service=app git=***REDACTED*** git
    INFO  service=bus type=storage.write subscribing
    INFO  service=app name=bus registering service
    INFO  service=format init
    INFO  service=bus type=file.edited subscribing
    INFO  service=bus type=* subscribing
    INFO  service=config.hooks init
    INFO  service=bus type=file.edited subscribing
    INFO  service=bus type=session.idle subscribing
    INFO  service=app name=lsp registering service
    INFO  service=app name=config registering service
    INFO  service=config path=***REDACTED***/.config/opencode/config.json loading
    INFO  service=config path=***REDACTED***/.config/opencode/opencode.json loading
    INFO  service=config path=***REDACTED***/.config/opencode/opencode.jsonc loading
    INFO  service=config path=***REDACTED***/projetos/PIX-OUT-PGW-2025/opencode.json loading
    INFO  service=config $schema=https://opencode.ai/config.json lsp={"typescript":{"disabled":true},"tsserver":{"command":["bunx","typescript-language-server","--stdio"],"extensions":[".ts"]}} agent={} mode={} plugin=[] username=***REDACTED*** loaded
    INFO  service=lsp.client serverID=typescript starting client
    INFO  service=lsp.client serverID=typescript sending initialize
    INFO  service=lsp.client serverID=typescript initialized
    INFO  service=app name=lsp shutdown
    INFO  service=lsp.client serverID=typescript shutting down
    INFO  service=lsp.client serverID=typescript shutdown
    ERROR service=default name=TypeError message=server.root is not a function. (In 'server.root(file2, App.info())', 'server.root' is undefined) fatal
    
  2. self-assigned this
    on Aug 4, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions