{"record":{"id":"deaeaaf39d48022f","repo":"eyaltoledano/claude-task-master","slug":"spinner-messages-must-be-an-array","errorCode":null,"errorMessage":"Spinner messages must be an array","messagePattern":"Spinner messages must be an array","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/progress/progress-tracker-builder.js","lineNumber":55,"sourceCode":"\n\twithPercent() {\n\t\tthis.config.addFeature('percent');\n\t\treturn this;\n\t}\n\n\twithTokens() {\n\t\tthis.config.addFeature('tokens');\n\t\treturn this;\n\t}\n\n\twithTasks() {\n\t\tthis.config.addFeature('tasks');\n\t\treturn this;\n\t}\n\n\twithSpinner(messages) {\n\t\tif (!messages || !Array.isArray(messages)) {\n\t\t\tthrow new Error('Spinner messages must be an array');\n\t\t}\n\t\tthis.config.spinnerFrames = messages;\n\t\treturn this;\n\t}\n\n\twithUnits(total, unitName = 'unit') {\n\t\tthis.config.totalUnits = total;\n\t\tthis.config.unitName = unitName;\n\t\treturn this;\n\t}\n\n\tbuild() {\n\t\treturn new ProgressTracker(this.config);\n\t}\n}\n\n/**\n * Base progress tracker with configurable features","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/src/progress/progress-tracker-builder.js#L37-L73","documentation":"ProgressTrackerBuilder.withSpinner() requires its argument to be an array of spinner frames/messages; passing null, undefined, or a non-array (e.g. a single string) throws immediately. This is a fluent-builder guard to fail fast on malformed configuration.","triggerScenarios":"builder.withSpinner('Loading...') (a string instead of an array) or withSpinner(null) / withSpinner(undefined).","commonSituations":"Assuming withSpinner accepts a single message string, passing a config value that is optionally undefined, wiring spinner text from a config file that supplies a string.","solutions":["Wrap the message in an array: withSpinner(['Loading...']).","Default to an empty/guarded value when config may be absent: withSpinner(config.frames ?? []).","Convert a single string to an array at the call site before invoking.","Check the builder API docs — frames, not a single message, are expected."],"exampleFix":"// before\n// trackerBuilder.withSpinner('Working')\n// after\n// trackerBuilder.withSpinner(['Working', 'Still working...', 'Almost done'])","handlingStrategy":"validation","validationCode":"function safeWithSpinner(builder, messages) {\n  const frames = typeof messages === 'string' ? [messages] : Array.isArray(messages) ? messages : [];\n  return frames.length ? builder.withSpinner(frames) : builder;\n}","typeGuard":"function isSpinnerFrames(v) {\n  return Array.isArray(v) && v.every((x) => typeof x === 'string');\n}","tryCatchPattern":"try {\n  builder.withSpinner(config.spinnerMessages);\n} catch (e) {\n  if (e.message === 'Spinner messages must be an array') {\n    builder.withSpinner(['Working...']); // sensible default\n  } else throw e;\n}","preventionTips":["Always pass arrays, even for a single message: ['Loading...']","Coerce single strings to arrays at the call site","Default optional config values to [] with ?? ​[]","Type-check spinner frames if using TypeScript"],"tags":["validation","argument-type","progress-tracker","builder"],"backgroundTag":"invalid-argument-type","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}