{"record":{"id":"4dd478c78ec514ca","repo":"eyaltoledano/claude-task-master","slug":"multibar-instance-is-required","errorCode":null,"errorMessage":"Multibar instance is required","messagePattern":"Multibar instance is required","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"src/progress/tracker-ui.js","lineNumber":9,"sourceCode":"import chalk from 'chalk';\n\n/**\n * Factory for creating progress bar elements\n */\nclass ProgressBarFactory {\n\tconstructor(multibar) {\n\t\tif (!multibar) {\n\t\t\tthrow new Error('Multibar instance is required');\n\t\t}\n\t\tthis.multibar = multibar;\n\t}\n\n\t/**\n\t * Creates a progress bar with the given format\n\t */\n\tcreateBar(format, payload = {}) {\n\t\tif (typeof format !== 'string') {\n\t\t\tthrow new Error('Format must be a string');\n\t\t}\n\n\t\tconst bar = this.multibar.create(\n\t\t\t1, // total\n\t\t\t1, // current\n\t\t\t{},\n\t\t\t{\n\t\t\t\tformat,","sourceCodeStart":1,"sourceCodeEnd":27,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/src/progress/tracker-ui.js#L1-L27","documentation":"ProgressBarFactory's constructor requires a live multibar instance (from cli-progress MultiBar) and throws if it is falsy. The factory delegates all bar creation to this instance, so it cannot function without it.","triggerScenarios":"new ProgressBarFactory() or new ProgressBarFactory(null/undefined) — usually because the multibar was not yet created or was already closed/destroyed before the factory was constructed.","commonSituations":"Creating the factory before initializing cli-progress MultiBar, storing the multibar in a lazily-initialized singleton that is still undefined, passing the wrong variable (undefined due to a typo or failed import).","solutions":["Create the multibar first: const multibar = new cliProgress.MultiBar({...}); then pass it to ProgressBarFactory.","Check the variable passed in for typos/undefined at the construction site.","Ensure the factory is instantiated after progress system initialization, not at module load time.","Verify the multibar hasn't been stopped/destroyed earlier in teardown code."],"exampleFix":"// before\n// const factory = new ProgressBarFactory(multibar); // multibar undefined\n// after\n// const multibar = new cliProgress.MultiBar({ clearOnComplete: true });\n// const factory = new ProgressBarFactory(multibar);","handlingStrategy":"validation","validationCode":"function createProgressFactory(multibar) {\n  if (!multibar || typeof multibar.create !== 'function') {\n    throw new Error('Provide an initialized cli-progress MultiBar before creating ProgressBarFactory');\n  }\n  return new ProgressBarFactory(multibar);\n}","typeGuard":"function isMultiBar(m) {\n  return m != null && typeof m === 'object' && typeof m.create === 'function';\n}","tryCatchPattern":"try {\n  const factory = new ProgressBarFactory(multibar);\n} catch (e) {\n  if (e.message === 'Multibar instance is required') {\n    multibar = new cliProgress.MultiBar({}, cliProgress.Presets.shades_classic);\n    return new ProgressBarFactory(multibar);\n  }\n  throw e;\n}","preventionTips":["Initialize MultiBar before any factory/consumer code runs","Avoid constructing progress UIs at module top-level before init","Guard lazy singletons so multibar is created on first access","Don't reuse a multibar after calling stop()"],"tags":["validation","progress-bar","constructor","null-argument"],"backgroundTag":"missing-required-argument","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}