{"record":{"id":"b947bcb2a64eb949","repo":"microsoft/typescript-go","slug":"could-not-find-a-typescript-executable-in-the-exte","errorCode":null,"errorMessage":"Could not find a TypeScript executable in the extension package.","messagePattern":"Could not find a TypeScript executable in the extension package\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"critical","filePath":"_extension/src/util.ts","lineNumber":86,"sourceCode":"    return tryGetPackagedExePath(extension.extensionUri, getBundledTypeScriptVersion(extension.packageJSON));\r\n}\r\n\r\nexport async function getDefaultExePath(context: vscode.ExtensionContext): Promise<ExeInfo> {\r\n    if (enableContributedNightlyVersion) {\r\n        const nightlyExe = await getNightlyExePath();\r\n        if (nightlyExe) {\r\n            return nightlyExe;\r\n        }\r\n    }\r\n    return getBuiltinExePath(context);\r\n}\r\n\r\nasync function getPackagedExePath(extensionUri: vscode.Uri, version: unknown): Promise<ExeInfo> {\r\n    const exe = await tryGetPackagedExePath(extensionUri, version);\r\n    if (exe) {\r\n        return exe;\r\n    }\r\n    throw new Error(vscode.l10n.t(\"Could not find a TypeScript executable in the extension package.\"));\r\n}\r\n\r\nfunction getBundledTypeScriptVersion(packageJSON: unknown): string {\r\n    if (packageJSON && typeof packageJSON === \"object\" && \"bundledTypeScriptVersion\" in packageJSON) {\r\n        const version = packageJSON.bundledTypeScriptVersion;\r\n        if (typeof version === \"string\") {\r\n            return version;\r\n        }\r\n    }\r\n    return \"unknown\";\r\n}\r\n\r\nasync function tryGetPackagedExePath(extensionUri: vscode.Uri, version: unknown): Promise<ExeInfo | undefined> {\r\n    for (const baseName of packagedExeBaseNames) {\r\n        const exeName = `${baseName}${process.platform === \"win32\" ? \".exe\" : \"\"}`;\r\n        const exePath = vscode.Uri.joinPath(extensionUri, \"lib\", exeName);\r\n        try {\r\n            await vscode.workspace.fs.stat(exePath);\r","sourceCodeStart":68,"sourceCodeEnd":104,"githubUrl":"https://github.com/microsoft/typescript-go/blob/1bcfa18d79a3be41772223d5c05dfe4480e614ff/_extension/src/util.ts#L68-L104","documentation":"Thrown by getPackagedExePath in the extension's util.ts when neither lib/tsc nor lib/tsgo (plus .exe on Windows) exists under the extension root (or the nightly extension root). tryGetPackagedExePath stats both names and returns undefined on failure, so this error means the extension installation contains no language-server binary at all - the server can never start.","triggerScenarios":"VSIX installed without platform binaries (universal/web build on a desktop machine), extension files quarantined or pruned by antivirus/IT policy, corrupted marketplace download, dev-mode (ExtensionMode.Development) where ../built/local/tsgo was not built and the fallback lib lookup also fails.","commonSituations":"Unsupported platform (no prebuilt tsgo for that os/arch); nightly extension (TypeScriptTeam.vscode-typescript-nightly) installed with missing lib folder; running the extension from source without executing hereby build first; partially-synced extension directories.","solutions":["Fully uninstall and reinstall the extension so the platform-specific VSIX with lib/tsgo is fetched","If running from source, build the native binary first: hereby build (produces built/local/tsgo next to the repo)","Verify the binary exists: ls <extensions dir>/typescript-native-preview-*/lib/tsgo (tsgo.exe on Windows)","Confirm your OS/arch is supported by a tsgo prebuilt; if not, fall back to the built-in TypeScript extension","Check antivirus/endpoint-protection logs for quarantine of the unsigned tsgo binary and allowlist it"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Verify packaged binaries exist before attempting to start the server\nimport * as fs from 'fs';\nimport * as path from 'path';\nconst lib = path.join(extensionPath, 'lib');\nconst hasBinary = ['tsgo', 'tsc'].some(n => fs.existsSync(path.join(lib, n + (process.platform === 'win32' ? '.exe' : ''))));\nif (!hasBinary) throw new Error('Extension install is missing lib/tsgo - reinstall the platform VSIX');","typeGuard":null,"tryCatchPattern":"try {\n    exe = await getBuiltinExePath(context);\n} catch (e) {\n    if (e instanceof Error && e.message.includes('Could not find a TypeScript executable')) {\n        // guide reinstall instead of a silent fallback\n        vscode.window.showErrorMessage('TypeScript 7 install incomplete - reinstall the extension.');\n    } else throw e;\n}","preventionTips":["In CI/dev, run hereby build before launching the extension host","Pin the platform-specific VSIX in managed installs so lib/tsgo is present","Allowlist tsgo/tsgo.exe in antivirus to prevent post-install binary removal"],"tags":["vscode-extension","installation","binary","platform","filesystem"],"backgroundTag":null,"analyzedSha":"1bcfa18d79a3be41772223d5c05dfe4480e614ff","analyzedAt":"2026-08-16T02:12:00.115Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}