{"record":{"id":"b8e480ab5db55a10","repo":"oraios/serena","slug":"svelte-companion-typescript-server-project-indexin","errorCode":null,"errorMessage":"Svelte companion TypeScript server project indexing did not complete within {timeout:.0f}s ({self.describe_indexing_state()})","messagePattern":"Svelte companion TypeScript server project indexing did not complete within (.+?)s \\((.+?)\\)","errorType":"exception","errorClass":"TimeoutError","httpStatus":null,"severity":"error","filePath":"src/solidlsp/language_servers/svelte_language_server.py","lineNumber":160,"sourceCode":"        }\n        return params\n\n    @override\n    def _start_server(self) -> None:\n        def workspace_configuration_handler(params: dict) -> list:\n            items = params.get(\"items\", [])\n            return [{} for _ in items]\n\n        self.server.on_request(\"workspace/configuration\", workspace_configuration_handler)\n        super()._start_server()\n\n    @override\n    def _handle_server_ready_timeout(self, timeout: float) -> None:\n        raise TimeoutError(f\"Svelte companion TypeScript server did not become ready within {timeout:.0f}s\")\n\n    @override\n    def _handle_project_indexing_timeout(self, timeout: float) -> None:\n        raise TimeoutError(\n            f\"Svelte companion TypeScript server project indexing did not complete within {timeout:.0f}s ({self.describe_indexing_state()})\"\n        )\n\n\nclass SvelteLanguageServer(SolidLanguageServer):\n    \"\"\"\n    Svelte language server using ``svelte-language-server``.\n\n    ``ls_specific_settings[\"svelte\"]`` keys:\n        * ``svelte_language_server_version``: version of ``svelte-language-server``\n          to install (default: ``0.18.0``).\n        * ``npm_registry``: optional alternative npm-compatible registry URL.\n        * ``indexing_timeout``: optional timeout in seconds for companion TS indexing of\n          Svelte files. Falls back to ``ls_specific_settings[\"typescript\"].indexing_timeout``\n          or the Svelte companion default.\n        * ``initialization_options_configuration``: optional dict merged into\n          ``initializeParams.initializationOptions.configuration`` (same top-level keys as in\n          Svelte Language Tools: ``svelte``, ``prettier``, ``typescript``, …).","sourceCodeStart":142,"sourceCodeEnd":178,"githubUrl":"https://github.com/oraios/serena/blob/7fcbca7e62555ec2287ddb2f083caee805848ea6/src/solidlsp/language_servers/svelte_language_server.py#L142-L178","documentation":"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.","triggerScenarios":"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.","commonSituations":"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).","solutions":["Raise the project-indexing timeout in the LanguageServerConfig.","Tighten tsconfig include/exclude so the companion TS server doesn't index node_modules or unrelated dirs.","Read describe_indexing_state() from the message to see which phase stalls and fix that phase (e.g. missing dependency).","Warm caches / move the workspace to local (non-network) storage before starting the server."],"exampleFix":"// before: tsconfig scanning everything\n{ \"include\": [\"**/*\"] }\n// after\n{ \"include\": [\"src/**/*.ts\", \"src/**/*.svelte\"], \"exclude\": [\"node_modules\", \"dist\"] }","handlingStrategy":"try-catch","validationCode":"# keep the TS project small before init\ncfg = {\"include\": [\"src/**/*\"], \"exclude\": [\"node_modules\", \"dist\"]}\nimport json, pathlib\n(pathlib.Path(repo_root) / \"tsconfig.json\").write_text(json.dumps(cfg))","typeGuard":"def tsconfig_scoped(repo_root: str) -> bool:\n    import json\n    from pathlib import Path\n    p = Path(repo_root) / \"tsconfig.json\"\n    if not p.exists():\n        return True\n    cfg = json.loads(p.read_text())\n    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\"))","tryCatchPattern":"try:\n    server = SvelteLanguageServer(config, repo_root, settings)\n    server.start()\nexcept TimeoutError as e:\n    if \"project indexing did not complete\" in str(e):\n        config.indexing_timeout = 600\n        server = SvelteLanguageServer(config, repo_root, settings)\n        server.start()\n    else:\n        raise","preventionTips":["Scope tsconfig include/exclude so node_modules and build output are not indexed.","Raise the project-indexing timeout for monorepos and network-mounted workspaces.","Use the describe_indexing_state() text in the message to identify the stalled phase."],"tags":["svelte","typescript","timeout","indexing"],"backgroundTag":"lsp-indexing-timeout","analyzedSha":"7fcbca7e62555ec2287ddb2f083caee805848ea6","analyzedAt":"2026-08-29T00:04:09.619Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}