{"record":{"id":"e2b84c24323e5a6e","repo":"yamadashy/repomix","slug":"cannot-split-output-group-rootentry-exceeds","errorCode":null,"errorMessage":"Cannot split output: '${group.rootEntry}' exceeds max size on its own. Size ${nextBytes.toLocaleString()} bytes > limit ${maxBytesPerPart.toLocaleString()} bytes. A single file cannot be split across parts.","messagePattern":"Cannot split output: '(.+?)' exceeds max size on its own\\. Size (.+?) bytes > limit (.+?) bytes\\. A single file cannot be split across parts\\.","errorType":"exception","errorClass":"RepomixError","httpStatus":null,"severity":"error","filePath":"src/core/output/outputSplit.ts","lineNumber":280,"sourceCode":"    }\n\n    // The group does not fit alongside what is already accumulated: flush the current part\n    // and retry this group on a fresh part.\n    if (currentGroups.length > 0) {\n      finalizeCurrentPart();\n      queue.unshift(group);\n      continue;\n    }\n\n    // The group does not fit even on its own. Split it one directory level deeper and retry\n    // the finer-grained groups. Only a single file cannot be divided further.\n    const subGroups = subdivideSplitGroup(group);\n    if (subGroups) {\n      queue.unshift(...subGroups);\n      continue;\n    }\n\n    throw new RepomixError(\n      `Cannot split output: '${group.rootEntry}' exceeds max size on its own. ` +\n        `Size ${nextBytes.toLocaleString()} bytes > limit ${maxBytesPerPart.toLocaleString()} bytes. ` +\n        'A single file cannot be split across parts.',\n    );\n  }\n\n  if (currentGroups.length > 0) {\n    finalizeCurrentPart();\n  }\n\n  return parts;\n};\n","sourceCodeStart":262,"sourceCodeEnd":293,"githubUrl":"https://github.com/yamadashy/repomix/blob/f465ad909315a22120636baf03fa5e28701a50cb/src/core/output/outputSplit.ts#L262-L293","documentation":"The split algorithm subdivides groups (directories) until each fits within maxBytesPerPart; when it reaches a leaf whose content is a single file larger than the limit — and files cannot be subdivided — it throws. Repomix refuses to split a single file across parts, so the requested per-part size is below the largest file's size.","triggerScenarios":"Running split output with maxBytesPerPart smaller than the largest processed file's byte size (group.rootEntry); the subdivision queue drains to that single oversized group and throws instead of emitting an invalid part.","commonSituations":"Setting a small per-part limit (e.g. 100KB) while the repo contains a big bundled/minified file or large dataset; limit tuned for average size, not max file size.","solutions":["Increase maxBytesPerPart to at least the size of the largest file (find it, e.g. via the size metric in repomix output).","Exclude the oversized file via ignore patterns (or it likely shouldn't be packed: minified/binary/lock files).","Split the large file into smaller files in the repo before packing."],"exampleFix":"// before\nawait generateSplitOutputParts({ maxBytesPerPart: 100_000, ... }); // huge-file.ts is 250KB\n// after\nawait generateSplitOutputParts({ maxBytesPerPart: 512_000, ... }); // > largest single file","handlingStrategy":"validation","validationCode":"const maxFileSize = Math.max(...processedFiles.map(f => f.content.length));\nif (maxFileSize > maxBytesPerPart) {\n  // exclude or raise limit before splitting\n}","typeGuard":"null","tryCatchPattern":"try {\n  await generateSplitOutputParts({ maxBytesPerPart, ... });\n} catch (e) {\n  if (e instanceof RepomixError && e.message.includes('exceeds max size on its own')) {\n    console.error('Raise maxBytesPerPart above the largest file, or ignore that file');\n  } else throw e;\n}","preventionTips":["Compute max processed-file size before choosing the per-part limit.","Ignore minified, bundled, and lock files via ignore patterns.","Set the limit as a multiple of expected largest file size.","Keep large data assets out of the packed set."],"tags":["output-split","file-size","limit-exceeded"],"backgroundTag":"size-limit-exceeded","analyzedSha":"f465ad909315a22120636baf03fa5e28701a50cb","analyzedAt":"2026-08-29T01:27:42.024Z","schemaVersion":2},"datasetVersion":"2026-08-29T02:17:18.158Z"}