{"record":{"id":"479a018790ec3a99","repo":"tldraw/tldraw","slug":"extension-temp-directory-not-found-make-sure-pack","errorCode":null,"errorMessage":"Extension temp directory not found. Make sure packaging completed successfully.","messagePattern":"Extension temp directory not found\\. Make sure packaging completed successfully\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"internal/scripts/publish-editor-extensions.ts","lineNumber":64,"sourceCode":"\n\tconst packageJsonPath = path.join(EXTENSION_DIR, 'package.json')\n\tif (!existsSync(packageJsonPath)) {\n\t\tthrow new Error(\"Could not find the extension's package.json file.\")\n\t}\n\tconst packageJson = JSON.parse(readFileSync(packageJsonPath, 'utf8'))\n\tpackageJson.version = nextVersion\n\twriteFileSync(packageJsonPath, JSON.stringify(packageJson, null, '\\t') + '\\n')\n\treturn nextVersion\n}\n\nasync function copyExtensionToReleaseFolder(version: string) {\n\tif (!existsSync(DISTRIBUTION_DIR)) {\n\t\tmkdirSync(DISTRIBUTION_DIR, { recursive: true })\n\t}\n\n\tconst tempDir = path.join(EXTENSION_DIR, 'temp')\n\tif (!existsSync(tempDir)) {\n\t\tthrow new Error(\n\t\t\t'Extension temp directory not found. Make sure packaging completed successfully.'\n\t\t)\n\t}\n\n\tconst files = readdirSync(tempDir)\n\tconst vsixFile = files.find((file: string) => file.endsWith('.vsix'))\n\tif (!vsixFile) {\n\t\tthrow new Error('No .vsix file found in temp directory.')\n\t}\n\n\tconst sourcePath = path.join(tempDir, vsixFile)\n\tconst targetPath = path.join(DISTRIBUTION_DIR, 'tldraw-vscode.vsix')\n\n\tnicelog(`Copying extension from ${sourcePath} to ${targetPath}`)\n\tcopyFileSync(sourcePath, targetPath)\n\n\tnicelog('Setting git user identity...')\n\tawait exec('git', ['config', 'user.name', 'huppy-bot[bot]'])","sourceCodeStart":46,"sourceCodeEnd":82,"githubUrl":"https://github.com/tldraw/tldraw/blob/b31086b44731a7d1d9d46be4163ac8ef7417321d/internal/scripts/publish-editor-extensions.ts#L46-L82","documentation":"Thrown by copyExtensionToReleaseFolder() when apps/vscode/extension/temp/ does not exist. The temp dir is supposed to hold the packaged .vsix produced by the preceding `yarn package` step. If it is missing, packaging failed, did not run, or wrote to a different location.","triggerScenarios":"existsSync(path.join(EXTENSION_DIR, 'temp')) returns false, after `yarn package` (production) or `yarn package --pre-release` (staging) was supposed to run.","commonSituations":"`yarn package` failed but the error was swallowed or this function was reached anyway; the package script changed its output directory; clean working tree where temp is gitignored and never created; the build step (`yarn lazy run build --filter=packages/*`) that package depends on failed earlier.","solutions":["Run `yarn package` manually in apps/vscode/extension and check its output for errors","Verify the package script writes the .vsix into ./temp","Ensure the prerequisite `yarn lazy run build --filter=packages/*` completed successfully before packaging","Check that cwd is the repo root so the relative temp path resolves"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// check that packaging actually produced a vsix before copying\nconst tempDir = path.join(EXTENSION_DIR, 'temp')\nif (!existsSync(tempDir) || readdirSync(tempDir).some((f) => f.endsWith('.vsix')) === false) {\n  throw new Error('Packaging did not produce a .vsix in temp — run yarn package and inspect its output')\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Check the exit code of `yarn package` explicitly before copying","Ensure the build prerequisite (`yarn lazy run build --filter=packages/*`) completed","Confirm the package script still writes to ./temp and update EXTENSION_DIR if it moved"],"tags":["vscode","build","packaging"],"backgroundTag":null,"analyzedSha":"b31086b44731a7d1d9d46be4163ac8ef7417321d","analyzedAt":"2026-08-12T17:05:39.947Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}