{"record":{"id":"44a8334b6c9d7cec","repo":"microsoft/typescript-go","slug":"source-file-does-not-exist-src","errorCode":null,"errorMessage":"Source file does not exist: ${src}","messagePattern":"Source file does not exist: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"Herebyfile.mjs","lineNumber":1299,"sourceCode":" *\r\n * @param {DDSignFileList} filelist\r\n */\r\nasync function sign(filelist, unchangedOutputOkay = false) {\r\n    let data = JSON.stringify(filelist, undefined, 4);\r\n    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","sourceCodeStart":1281,"sourceCodeEnd":1317,"githubUrl":"https://github.com/microsoft/typescript-go/blob/1bcfa18d79a3be41772223d5c05dfe4480e614ff/Herebyfile.mjs#L1281-L1317","documentation":"In fake-signing mode (MBSIGN_APPFOLDER unset), every SignFileList entry's SrcPath is checked with fs.existsSync before a stand-in signature is written. A missing source file aborts the fake-sign run instead of producing bogus output.","triggerScenarios":"Running the sign task before the artifacts listed in the signing filelist were built, after built/ outputs were cleaned, or with a filelist containing stale/wrong SrcPath values.","commonSituations":"Testing the signing flow locally without a full build; regenerating filelists that reference renamed or removed outputs.","solutions":["Run the build/packaging tasks that produce the listed artifacts before the signing task","Regenerate the signing filelist so SrcPath matches current artifact paths","Remove entries from the filelist for artifacts that no longer exist"],"exampleFix":null,"handlingStrategy":"validation","validationCode":"import fs from \"node:fs\";\nfor (const record of filelist.SignFileRecordList) {\n  for (const f of record.SignFileList) {\n    if (!fs.existsSync(f.SrcPath)) throw new Error(`Build artifact missing before signing: ${f.SrcPath}`);\n  }\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Make signing tasks depend on the build/packaging tasks that produce the filelist artifacts","Regenerate the signing filelist whenever artifact paths change","In local fake-sign runs, do a full build first"],"tags":["signing","build","verification","filesystem"],"backgroundTag":null,"analyzedSha":"1bcfa18d79a3be41772223d5c05dfe4480e614ff","analyzedAt":"2026-08-16T02:12:00.115Z","schemaVersion":2},"datasetVersion":"2026-08-16T03:17:38.424Z"}