{"record":{"id":"8308602fe4b4798a","repo":"microsoft/TypeScript","slug":"the-project-s-language-service-is-disabled","errorCode":null,"errorMessage":"The project's language service is disabled.","messagePattern":"The project's language service is disabled\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/server/utilitiesPublic.ts","lineNumber":62,"sourceCode":"export function createInstallTypingsRequest(project: Project, typeAcquisition: TypeAcquisition, unresolvedImports: SortedReadonlyArray<string>, cachePath?: string): DiscoverTypings {\r\n    return {\r\n        projectName: project.getProjectName(),\r\n        fileNames: project.getFileNames(/*excludeFilesFromExternalLibraries*/ true, /*excludeConfigFiles*/ true).concat(project.getExcludedFiles() as NormalizedPath[]),\r\n        compilerOptions: project.getCompilationSettings(),\r\n        typeAcquisition,\r\n        unresolvedImports,\r\n        projectRootPath: project.getCurrentDirectory() as Path,\r\n        cachePath,\r\n        kind: \"discover\",\r\n    };\r\n}\r\n\r\nexport namespace Errors {\r\n    export function ThrowNoProject(): never {\r\n        throw new Error(\"No Project.\");\r\n    }\r\n    export function ThrowProjectLanguageServiceDisabled(): never {\r\n        throw new Error(\"The project's language service is disabled.\");\r\n    }\r\n    export function ThrowProjectDoesNotContainDocument(fileName: string, project: Project): never {\r\n        throw new Error(`Project '${project.getProjectName()}' does not contain document '${fileName}'`);\r\n    }\r\n}\r\n\r\nexport type NormalizedPath = string & { __normalizedPathTag: any; };\r\n\r\nexport function toNormalizedPath(fileName: string): NormalizedPath {\r\n    return normalizePath(fileName) as NormalizedPath;\r\n}\r\n\r\nexport function normalizedPathToPath(normalizedPath: NormalizedPath, currentDirectory: string, getCanonicalFileName: (f: string) => string): Path {\r\n    const f = isRootedDiskPath(normalizedPath) ? normalizedPath : getNormalizedAbsolutePath(normalizedPath, currentDirectory);\r\n    return getCanonicalFileName(f) as Path;\r\n}\r\n\r\nexport function asNormalizedPath(fileName: string): NormalizedPath {\r","sourceCodeStart":44,"sourceCodeEnd":80,"githubUrl":"https://github.com/microsoft/TypeScript/blob/b465fdbfe175304d9b977da137b2c178ae1091d3/src/server/utilitiesPublic.ts#L44-L80","documentation":"Thrown via Errors.ThrowProjectLanguageServiceDisabled() (utilitiesPublic.ts:62). It fires when a request requires the language service but the resolved Project has languageServiceEnabled === false — typically because the project exceeded configured resource thresholds (file count / memory) and was downgraded to a syntax-only project, or because the project type does not provide a language service.","triggerScenarios":"A project exceeds the file-count or memory ceiling (e.g. maxTsServerMemory, maxProjectFileCount) and tsserver disables its language service; the client then issues a language-service command for a file in that project, which routes through ThrowProjectLanguageServiceDisabled.","commonSituations":"Very large monorepos where one configured project crosses the threshold; tight memory limits in the editor; an inferred/external project that does not get a language service; a downgraded project after the user added many files.","solutions":["Raise the resource limits in tsserver configuration (maxTsServerMemory, maxProjectFileCount) so the project qualifies for a language service.","Split the oversized project into smaller tsconfigs (project references) so each stays under the threshold.","Move the file into a configured project (tsconfig.json include) instead of an inferred/external project.","Restart tsserver after changing limits so the project reloads with language service re-enabled.","On the client, surface a clear 'language service disabled for this project' UX instead of letting the request throw."],"exampleFix":"// before — large project trips the threshold\n// tsserver started with default limits; project downgraded to syntax-only\n\n// after — raise limits and restart\n// editor settings / tsserver config:\n//   maxTsServerMemory: 8192\n//   maxProjectFileCount: 50000\n// then restart the language server","handlingStrategy":"validation","validationCode":"// Check the project's language-service flag before issuing requests.\nfunction ensureLanguageServiceEnabled(project: Project): void {\n  if (!project.languageServiceEnabled) {\n    throw new Error(`Language service disabled for ${project.getProjectName()}. Raise limits or split the project.`);\n  }\n}","typeGuard":"function projectHasLanguageService(project: Project): boolean {\n  return project.languageServiceEnabled === true;\n}","tryCatchPattern":null,"preventionTips":["Raise maxTsServerMemory / maxProjectFileCount to keep projects under the language-service threshold.","Split large projects with project references so each stays under the limit.","Monitor tsserver logs for project-downgrade events and warn the user."],"tags":["server","tsserver","project","resource-limits","language-service"],"backgroundTag":null,"analyzedSha":"b465fdbfe175304d9b977da137b2c178ae1091d3","analyzedAt":"2026-08-12T05:38:42.698Z","schemaVersion":2},"datasetVersion":"2026-08-12T13:17:24.610Z"}