{"record":{"id":"2383f210877d8c1b","repo":"eyaltoledano/claude-task-master","slug":"prdfilepath-is-required-and-must-be-a-non-empty-st","errorCode":null,"errorMessage":"prdFilePath is required and must be a non-empty string","messagePattern":"prdFilePath is required and must be a non-empty string","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/ui/parse-prd.js","lineNumber":164,"sourceCode":"function displayParsePrdStart({\n\tprdFilePath,\n\toutputPath,\n\tnumTasks,\n\tmodel = CONSTANTS.DEFAULT_MODEL,\n\ttemperature = CONSTANTS.DEFAULT_TEMPERATURE,\n\tappend = false,\n\tresearch = false,\n\tforce = false,\n\texistingTasks = [],\n\tnextId = 1\n}) {\n\t// Input validation\n\tif (\n\t\t!prdFilePath ||\n\t\ttypeof prdFilePath !== 'string' ||\n\t\tprdFilePath.trim() === ''\n\t) {\n\t\tthrow new Error('prdFilePath is required and must be a non-empty string');\n\t}\n\tif (\n\t\t!outputPath ||\n\t\ttypeof outputPath !== 'string' ||\n\t\toutputPath.trim() === ''\n\t) {\n\t\tthrow new Error('outputPath is required and must be a non-empty string');\n\t}\n\n\t// Build and display the main message box\n\tconst message = buildMainMessage({\n\t\tprdFilePath,\n\t\toutputPath,\n\t\tnumTasks,\n\t\tmodel,\n\t\ttemperature,\n\t\tappend,\n\t\tresearch","sourceCodeStart":146,"sourceCodeEnd":182,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/src/ui/parse-prd.js#L146-L182","documentation":"displayParsePrdStart validates that a PRD file path was supplied before rendering the parse-prd progress UI. It throws when prdFilePath is missing, not a string, or an empty/whitespace-only string. This is an input-contract guard so the UI never renders a start banner for an unusable path.","triggerScenarios":"Calling displayParsePrdStart (directly or via setupProgressTracking) with prdFilePath undefined/null, a non-string value (e.g. an options object property that was never set), or a string of only whitespace such as '   '.","commonSituations":"CLI flag --prd omitted while options object still forwarded; config file where prd key is empty; programmatic use passing process.env.PRD_PATH when the env var is unset (undefined); refactors that renamed the option but left the old lookup returning undefined.","solutions":["Pass a valid prdFilePath string argument, e.g. displayParsePrdStart('.taskmaster/prd.txt', outputDir, options)","Check the CLI/config layer that resolves the PRD path and ensure it defaults to '.taskmaster/prd.txt' or fails earlier with a friendly message","Log the value before the call to confirm it is a non-empty string (typeof v === 'string' && v.trim() !== '')"],"exampleFix":"// before\ndisplayParsePrdStart(options.prdPath, options.output, options);\n// after\nif (typeof options.prdPath !== 'string' || options.prdPath.trim() === '') {\n  console.error('A PRD file path is required (--prd <file>)');\n  process.exit(1);\n}\ndisplayParsePrdStart(options.prdPath, options.output, options);","handlingStrategy":"validation","validationCode":"function isNonEmptyString(v) { return typeof v === 'string' && v.trim() !== ''; }\nif (!isNonEmptyString(prdFilePath)) throw new TypeError('prdFilePath must be a non-empty string before calling displayParsePrdStart');","typeGuard":"const isNonEmptyString = (v) => typeof v === 'string' && v.trim().length > 0;","tryCatchPattern":"try {\n  displayParsePrdStart(prdFilePath, outputPath, options);\n} catch (err) {\n  if (err.message.startsWith('prdFilePath is required')) {\n    console.error('Invalid PRD path:', prdFilePath);\n    process.exitCode = 1;\n  } else throw err;\n}","preventionTips":["Default the PRD path to '.taskmaster/prd.txt' when the flag is omitted","Validate CLI/config inputs once at entry, before any UI calls","Trim user-supplied paths and reject whitespace-only values early","Use a shared isNonEmptyString helper for all path arguments"],"tags":["validation","arguments","ui"],"backgroundTag":"missing-required-argument","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}