oraios/serena · error · TimeoutError

Svelte companion TypeScript server project indexing did not

Error message

Svelte companion TypeScript server project indexing did not complete within {timeout:.0f}s ({self.describe_indexing_state()})

What it means

SvelteLanguageServer overrides _handle_project_indexing_timeout: if the Svelte/companion TypeScript server's project indexing does not finish within the configured indexing timeout, this TimeoutError is raised with a human-readable indexing-state snapshot from describe_indexing_state(). The server is up but never finished cataloguing the project, so requests would return incomplete results.

Source

Thrown at src/solidlsp/language_servers/svelte_language_server.py:160

        }
        return params

    @override
    def _start_server(self) -> None:
        def workspace_configuration_handler(params: dict) -> list:
            items = params.get("items", [])
            return [{} for _ in items]

        self.server.on_request("workspace/configuration", workspace_configuration_handler)
        super()._start_server()

    @override
    def _handle_server_ready_timeout(self, timeout: float) -> None:
        raise TimeoutError(f"Svelte companion TypeScript server did not become ready within {timeout:.0f}s")

    @override
    def _handle_project_indexing_timeout(self, timeout: float) -> None:
        raise TimeoutError(
            f"Svelte companion TypeScript server project indexing did not complete within {timeout:.0f}s ({self.describe_indexing_state()})"
        )


class SvelteLanguageServer(SolidLanguageServer):
    """
    Svelte language server using ``svelte-language-server``.

    ``ls_specific_settings["svelte"]`` keys:
        * ``svelte_language_server_version``: version of ``svelte-language-server``
          to install (default: ``0.18.0``).
        * ``npm_registry``: optional alternative npm-compatible registry URL.
        * ``indexing_timeout``: optional timeout in seconds for companion TS indexing of
          Svelte files. Falls back to ``ls_specific_settings["typescript"].indexing_timeout``
          or the Svelte companion default.
        * ``initialization_options_configuration``: optional dict merged into
          ``initializeParams.initializationOptions.configuration`` (same top-level keys as in
          Svelte Language Tools: ``svelte``, ``prettier``, ``typescript``, …).

View on GitHub (pinned to 7fcbca7e62)

Solutions

  1. Raise the project-indexing timeout in the LanguageServerConfig.
  2. Tighten tsconfig include/exclude so the companion TS server doesn't index node_modules or unrelated dirs.
  3. Read describe_indexing_state() from the message to see which phase stalls and fix that phase (e.g. missing dependency).
  4. Warm caches / move the workspace to local (non-network) storage before starting the server.

Example fix

// before: tsconfig scanning everything
{ "include": ["**/*"] }
// after
{ "include": ["src/**/*.ts", "src/**/*.svelte"], "exclude": ["node_modules", "dist"] }
Defensive patterns

Strategy: try-catch

Validate before calling

# keep the TS project small before init
cfg = {"include": ["src/**/*"], "exclude": ["node_modules", "dist"]}
import json, pathlib
(pathlib.Path(repo_root) / "tsconfig.json").write_text(json.dumps(cfg))

Type guard

def tsconfig_scoped(repo_root: str) -> bool:
    import json
    from pathlib import Path
    p = Path(repo_root) / "tsconfig.json"
    if not p.exists():
        return True
    cfg = json.loads(p.read_text())
    return "node_modules" in cfg.get("exclude", []) or any("node_modules" in i for i in cfg.get("include", [])) is False or bool(cfg.get("include"))

Try / catch

try:
    server = SvelteLanguageServer(config, repo_root, settings)
    server.start()
except TimeoutError as e:
    if "project indexing did not complete" in str(e):
        config.indexing_timeout = 600
        server = SvelteLanguageServer(config, repo_root, settings)
        server.start()
    else:
        raise

Prevention

When it happens

Trigger: Initializing the Svelte server on projects whose initial indexing (TS project loading, Svelte file scan) exceeds the indexing timeout — typically very large codebases or very slow disks/CI.

Common situations: Monorepos with thousands of TS/Svelte files, network-mounted workspaces, CI runners with minimal CPU, or projects with pathological tsconfig (excluding nothing, scanning node_modules).

Understand the failure class

Related errors


AI-assisted analysis of oraios/serena@7fcbca7e62 (2026-08-29). Data as JSON: /api/errors/b8e480ab5db55a10. Report an issue: GitHub.