{"record":{"id":"5ccfbf702e1c0603","repo":"remotion-dev/remotion","slug":"unable-to-calculate-the-changes-needed-for-this-file-edit-5ccfbf","errorCode":null,"errorMessage":"Unable to calculate the changes needed for this file. Edit the file manually.","messagePattern":"Unable to calculate the changes needed for this file\\. Edit the file manually\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/studio-codemods/src/folder-source-edits.ts","lineNumber":487,"sourceCode":"\tcodeMod,\n\tinput,\n}: {\n\tcodeMod: FolderCodemod;\n\tinput: string;\n}): {changesMade: Change[]; newContents: string} => {\n\tconst ast = parseAst(input);\n\tconst items = getLocatedItems(ast);\n\tconst folder =\n\t\tcodeMod.type === 'rename-folder' || codeMod.type === 'delete-folder'\n\t\t\t? getFolder({\n\t\t\t\t\tfolderName: codeMod.folderName,\n\t\t\t\t\titems,\n\t\t\t\t\tparentName: codeMod.parentName,\n\t\t\t\t})\n\t\t\t: null;\n\tconst {newAst, changesMade} = applyCodemod({file: ast, codeMod});\n\tif (changesMade.length === 0) {\n\t\tthrow new Error(\n\t\t\t'Unable to calculate the changes needed for this file. Edit the file manually.',\n\t\t);\n\t}\n\n\tlet edits: SourceEdit[];\n\tif (codeMod.type === 'new-folder') {\n\t\tedits = getNewFolderSourceEdits({ast: newAst, input});\n\t} else if (codeMod.type === 'rename-folder') {\n\t\tif (folder === null) {\n\t\t\tthrow new Error('Could not locate the folder to rename');\n\t\t}\n\n\t\tedits = [\n\t\t\tgetJsxStringAttributeValueSourceEdit({\n\t\t\t\tattribute: getFolderNameAttribute(folder.node),\n\t\t\t\tinput,\n\t\t\t\tnewValue: codeMod.newName,\n\t\t\t}),","sourceCodeStart":469,"sourceCodeEnd":505,"githubUrl":"https://github.com/remotion-dev/remotion/blob/46a3a6bf13ca367376ff18bbb06dae2e87e0d068/packages/studio-codemods/src/folder-source-edits.ts#L469-L505","documentation":"Thrown by editFolderInSource (folder-source-edits.ts:487) when applyCodemod completed but reported zero changes. The high-level AST transform (e.g. add/remove folder entries in the schema) did not actually alter the AST, so generating source edits would produce an unchanged file — Remotion surfaces a generic 'edit the file manually' message instead of silently doing nothing.","triggerScenarios":"Any FolderCodemod (new-folder, rename-folder, delete-folder, move-*) whose mutation is a no-op: the folder already exists with the requested shape, the rename yields the same name, the entry to delete is already absent, or the codemod data is out of sync with the file's AST.","commonSituations":"Clicking a Studio action twice so the second identical codemod finds nothing to change; the Root file was edited externally so the codemod's expected structure no longer exists; schema/state mismatch after hot reload.","solutions":["Reload the Studio so its internal state re-syncs with the Root file, then retry the action","Check whether the change already exists in the file (duplicate create/rename to the same name is a no-op)","Edit the Root file manually as the message suggests — wrap/unwrap the <Folder> or rename the name attribute by hand"],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"// Pre-check the mutation would change something\nif (folderAlreadyExists(input, codeMod) || folderAlreadyAbsent(input, codeMod)) {\n  return; // no-op; skip codemod entirely\n}","typeGuard":null,"tryCatchPattern":"try {\n  const {newContents, changesMade} = editFolderInSource({codeMod, input});\n} catch (e) {\n  if (e instanceof Error && e.message.startsWith('Unable to calculate the changes needed')) {\n    // treat as no-op; reload Studio state or edit the file manually\n  }\n}","preventionTips":["Avoid triggering the same Studio struct action twice","Reload Studio state after editing Root files externally","Verify the requested change actually differs from the current file state before applying"],"tags":["codemod","no-op","remotion-studio","ast"],"backgroundTag":"unsupported-operation","analyzedSha":"46a3a6bf13ca367376ff18bbb06dae2e87e0d068","analyzedAt":"2026-09-18T00:12:20.256Z","contentChangedAt":"2026-09-18T00:12:20.256Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}