{"record":{"id":"d9591eb9f950dade","repo":"cline/cline","slug":"cannot-create-filepath-with-no-content","errorCode":null,"errorMessage":"Cannot create ${filePath} with no content","messagePattern":"Cannot create (.+?) with no content","errorType":"exception","errorClass":"DiffError","httpStatus":null,"severity":"error","filePath":"sdk/packages/core/src/extensions/tools/executors/apply-patch.ts","lineNumber":293,"sourceCode":"\nasync function applyChanges(\n\tchanges: Record<string, PatchFileChange>,\n\tcwd: string,\n\tencoding: BufferEncoding,\n\trestrictToCwd: boolean,\n): Promise<string[]> {\n\tconst touched: string[] = [];\n\n\tfor (const [filePath, change] of Object.entries(changes)) {\n\t\tconst sourceAbsPath = resolveFilePath(cwd, filePath, restrictToCwd);\n\t\tswitch (change.type) {\n\t\t\tcase PatchActionType.DELETE:\n\t\t\t\tawait fs.rm(sourceAbsPath, { force: true });\n\t\t\t\ttouched.push(`${filePath}: [deleted]`);\n\t\t\t\tbreak;\n\t\t\tcase PatchActionType.ADD:\n\t\t\t\tif (change.newContent === undefined) {\n\t\t\t\t\tthrow new DiffError(`Cannot create ${filePath} with no content`);\n\t\t\t\t}\n\t\t\t\tawait fs.mkdir(path.dirname(sourceAbsPath), { recursive: true });\n\t\t\t\tawait fs.writeFile(sourceAbsPath, change.newContent, { encoding });\n\t\t\t\ttouched.push(filePath);\n\t\t\t\tbreak;\n\t\t\tcase PatchActionType.UPDATE: {\n\t\t\t\tif (change.newContent === undefined) {\n\t\t\t\t\tthrow new DiffError(\n\t\t\t\t\t\t`UPDATE change for ${filePath} has no new content`,\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tif (change.movePath) {\n\t\t\t\t\tconst moveAbsPath = resolveFilePath(\n\t\t\t\t\t\tcwd,\n\t\t\t\t\t\tchange.movePath,\n\t\t\t\t\t\trestrictToCwd,\n\t\t\t\t\t);","sourceCodeStart":275,"sourceCodeEnd":311,"githubUrl":"https://github.com/cline/cline/blob/491b30b806fdb8c93513f821f2b87d63a61542f5/sdk/packages/core/src/extensions/tools/executors/apply-patch.ts#L275-L311","documentation":"Error \"Cannot create ${filePath} with no content\" thrown in cline/cline.","triggerScenarios":"Thrown at sdk/packages/core/src/extensions/tools/executors/apply-patch.ts:293 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"491b30b806fdb8c93513f821f2b87d63a61542f5","analyzedAt":"2026-08-25T13:45:22.367Z","schemaVersion":2},"datasetVersion":"2026-08-25T21:54:21.419Z"}