{"record":{"id":"288a278c10041fb6","repo":"eyaltoledano/claude-task-master","slug":"payload-must-be-an-object","errorCode":null,"errorMessage":"Payload must be an object","messagePattern":"Payload must be an object","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/progress/tracker-ui.js","lineNumber":52,"sourceCode":"\t\tbar.update(1, payload);\n\t\treturn bar;\n\t}\n\n\t/**\n\t * Creates a header with borders\n\t */\n\tcreateHeader(headerFormat, borderFormat) {\n\t\tthis.createBar(borderFormat); // Top border\n\t\tthis.createBar(headerFormat); // Header\n\t\tthis.createBar(borderFormat); // Bottom border\n\t}\n\n\t/**\n\t * Creates a data row\n\t */\n\tcreateRow(rowFormat, payload) {\n\t\tif (!payload || typeof payload !== 'object') {\n\t\t\tthrow new Error('Payload must be an object');\n\t\t}\n\t\treturn this.createBar(rowFormat, payload);\n\t}\n\n\t/**\n\t * Creates a border element\n\t */\n\tcreateBorder(borderFormat) {\n\t\treturn this.createBar(borderFormat);\n\t}\n}\n\n/**\n * Creates a bordered header for progress tables.\n * @param {Object} multibar - The multibar instance.\n * @param {string} headerFormat - Format string for the header row.\n * @param {string} borderFormat - Format string for the top and bottom borders.\n * @returns {void}","sourceCodeStart":34,"sourceCodeEnd":70,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/src/progress/tracker-ui.js#L34-L70","documentation":"createRow() is a convenience wrapper around createBar() for data rows in the progress tracker UI. It validates that the payload holding the row's data exists and is an object before delegating to createBar. Passing null, undefined, or a primitive is rejected because the bar renderer needs to read named fields from the payload object.","triggerScenarios":"Calling tracker.createRow(rowFormat, null), createRow(rowFormat, undefined), createRow(rowFormat, 'string'), createRow(rowFormat, 42), or forgetting the payload argument entirely.","commonSituations":"Building row data dynamically where a lookup returns null/undefined before the row is created; spreads on a possibly-undefined object like {...maybeData} evaluated before a null check; calling the lower-level createRow API directly instead of createProgressRow/addTaskRow/addSummaryRow helpers which build the payload for you.","solutions":["Ensure the payload is a non-null object before calling createRow (e.g. const payload = row?.data ?? {}).","If the row should be optional, check the data first and skip the row instead of passing null.","Call the higher-level helpers createProgressRow/addTaskRow/addSummaryRow, which construct valid payloads.","Log the payload with console.log(JSON.stringify(payload)) to spot where it became null."],"exampleFix":"// before\nconst row = tasks.find(t => t.id === id);\ntracker.createRow(rowFormat, row?.data);\n// after\nconst row = tasks.find(t => t.id === id);\nif (row?.data) {\n  tracker.createRow(rowFormat, row.data);\n}","handlingStrategy":"type-guard","validationCode":"function isValidPayload(p) {\n  return p !== null && typeof p === 'object';\n}\n// usage\nif (!isValidPayload(payload)) throw new Error('createRow payload must be a non-null object');\ntracker.createRow(rowFormat, payload);","typeGuard":"const isRowPayload = (p) => p !== null && typeof p === 'object';","tryCatchPattern":"try {\n  tracker.createRow(rowFormat, payload);\n} catch (err) {\n  if (err.message === 'Payload must be an object') {\n    console.error('Row payload invalid:', payload);\n    return; // skip row or substitute defaults\n  }\n  throw err;\n}","preventionTips":["Build payloads through createProgressRow/addTaskRow/addSummaryRow instead of raw createRow when possible.","Use default object literals ({...data ?? {}}) when data may be absent.","Enable strict null checks so undefined payloads surface at compile time.","Validate row data at the data-fetch boundary before rendering."],"tags":["validation","argument-error","progress-ui"],"backgroundTag":"invalid-argument-type","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}