{"record":{"id":"f5ee7a58b8fdd1cf","repo":"eyaltoledano/claude-task-master","slug":"empty-file-path-provided","errorCode":null,"errorMessage":"Empty file path provided","messagePattern":"Empty file path provided","errorType":"console","errorClass":null,"httpStatus":null,"severity":"error","filePath":"scripts/modules/commands.js","lineNumber":2128,"sourceCode":"\t\t\t\t\t\t\t\t`Invalid task ID format: \"${trimmedId}\". Expected format: \"15\" or \"15.2\"`\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn trimmedId;\n\t\t\t\t\t});\n\t\t\t\t} catch (error) {\n\t\t\t\t\tconsole.error(chalk.red(`Error parsing task IDs: ${error.message}`));\n\t\t\t\t\tprocess.exit(1);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Validate and parse file paths if provided\n\t\t\tlet filePaths = [];\n\t\t\tif (options.files) {\n\t\t\t\ttry {\n\t\t\t\t\tfilePaths = options.files.split(',').map((filePath) => {\n\t\t\t\t\t\tconst trimmedPath = filePath.trim();\n\t\t\t\t\t\tif (trimmedPath.length === 0) {\n\t\t\t\t\t\t\tthrow new Error('Empty file path provided');\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn trimmedPath;\n\t\t\t\t\t});\n\t\t\t\t} catch (error) {\n\t\t\t\t\tconsole.error(\n\t\t\t\t\t\tchalk.red(`Error parsing file paths: ${error.message}`)\n\t\t\t\t\t);\n\t\t\t\t\tprocess.exit(1);\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t// Validate save-to option if provided\n\t\t\tif (options.saveTo) {\n\t\t\t\tconst saveToId = options.saveTo.trim();\n\t\t\t\tif (saveToId.length === 0) {\n\t\t\t\t\tconsole.error(chalk.red('Error: Save-to ID cannot be empty'));\n\t\t\t\t\tprocess.exit(1);\n\t\t\t\t}","sourceCodeStart":2110,"sourceCodeEnd":2146,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/scripts/modules/commands.js#L2110-L2146","documentation":"Thrown while parsing the --files option of commands that accept comma-separated file paths. After trimming, any empty token (e.g. from consecutive or trailing commas, or an empty option value) raises this error and aborts the command's file parsing.","triggerScenarios":"Calling a CLI command with --files=\"\" or --files=src/a.js,,src/b.js (empty token between commas) or --files=src/a.js, (trailing comma).","commonSituations":"Shell scripts assembling file lists where a variable is empty, hand-edited command lines leaving double commas, or automation piping a blank list into --files.","solutions":["Remove empty entries between/trailing commas: --files=src/a.js,src/b.js.","Guard scripts to omit --files entirely when the list is empty.","Filter blank items before joining the comma-separated list.","Check that the shell variable holding the file list is non-empty before invoking."],"exampleFix":"// before\n--files=src/a.js,,src/b.js\n// after\n--files=src/a.js,src/b.js","handlingStrategy":"validation","validationCode":"function parseFileList(filesOption) {\n  const list = filesOption.split(',').map(s => s.trim()).filter(Boolean);\n  if (list.length === 0) throw new Error('No valid file paths provided');\n  list.forEach(p => { if (!p) throw new Error('Empty file path provided'); });\n  return list;\n}","typeGuard":"const isNonEmptyPath = (s) => typeof s === 'string' && s.trim().length > 0;","tryCatchPattern":"try {\n  await runCommand({ files: options.files });\n} catch (e) {\n  if (e.message === 'Empty file path provided') {\n    console.error(chalk.red('Fix --files: remove empty entries, e.g. --files=src/a.js,src/b.js'));\n    process.exit(1);\n  }\n  throw e;\n}","preventionTips":["Filter out empty strings before joining file lists with commas.","Omit --files entirely when the list is empty rather than passing a blank value.","In scripts, default empty variables to skipping the flag."],"tags":["cli","validation","file-paths","arguments"],"backgroundTag":"empty-required-argument","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}