{"record":{"id":"d57c842db5759bbf","repo":"microsoft/typescript-go","slug":"destination-directory-does-not-exist-dstdir","errorCode":null,"errorMessage":"Destination directory does not exist: ${dstDir}","messagePattern":"Destination directory does not exist: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"Herebyfile.mjs","lineNumber":1304,"sourceCode":"    console.log(\"filelist:\", data);\r\n\r\n    if (!process.env.MBSIGN_APPFOLDER) {\r\n        console.log(pc.yellow(\"Faking signing because MBSIGN_APPFOLDER is not set.\"));\r\n\r\n        // Fake signing for testing.\r\n\r\n        for (const record of filelist.SignFileRecordList) {\r\n            for (const file of record.SignFileList) {\r\n                const src = file.SrcPath;\r\n                const dst = file.DstPath ?? src;\r\n\r\n                if (!fs.existsSync(src)) {\r\n                    throw new Error(`Source file does not exist: ${src}`);\r\n                }\r\n\r\n                const dstDir = path.dirname(dst);\r\n                if (!fs.existsSync(dstDir)) {\r\n                    throw new Error(`Destination directory does not exist: ${dstDir}`);\r\n                }\r\n\r\n                if (dst.endsWith(\".sig\")) {\r\n                    console.log(`Faking signature for ${src} -> ${dst}`);\r\n                    // No great way to fake a signature.\r\n                    await fs.promises.writeFile(dst, \"fake signature\");\r\n                }\r\n                else {\r\n                    if (src === dst) {\r\n                        console.log(`Faking signing ${src}`);\r\n                    }\r\n                    else {\r\n                        console.log(`Faking signing ${src} -> ${dst}`);\r\n                    }\r\n                    const contents = await fs.promises.readFile(src);\r\n                    await fs.promises.writeFile(dst, contents);\r\n                }\r\n            }\r","sourceCodeStart":1286,"sourceCodeEnd":1322,"githubUrl":"https://github.com/microsoft/typescript-go/blob/1bcfa18d79a3be41772223d5c05dfe4480e614ff/Herebyfile.mjs#L1286-L1322","documentation":"Fake-signing mode requires the destination directory (dirname of DstPath, or of SrcPath when DstPath is absent) to already exist before writing .sig or stand-in files. Missing output directories abort the run.","triggerScenarios":"DstPath points into a directory that no task created (typo, or the packaging step that creates it has not run), e.g. built/vsix/signatures/ does not exist yet.","commonSituations":"New signature output locations added to the filelist without a mkdir step; task reordering so signing runs before packaging creates directories.","solutions":["Ensure an earlier build/packaging task creates the destination directory","Fix DstPath typos so it points at an existing directory","Create the directory where the filelist is generated: fs.mkdirSync(path.dirname(dst), { recursive: true })"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import fs from \"node:fs\"; import path from \"node:path\";\nfor (const record of filelist.SignFileRecordList) {\n  for (const f of record.SignFileList) {\n    fs.mkdirSync(path.dirname(f.DstPath ?? f.SrcPath), { recursive: true });\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Create destination directories when generating the filelist, not during signing","Keep signing task ordering after packaging steps that create output dirs","Double-check DstPath values against the actual build layout"],"tags":["signing","filesystem","configuration"],"backgroundTag":null,"analyzedSha":"1bcfa18d79a3be41772223d5c05dfe4480e614ff","analyzedAt":"2026-08-16T02:12:00.115Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}