{"record":{"id":"051e488d974cbd78","repo":"eyaltoledano/claude-task-master","slug":"missing-configuration-051e48","errorCode":"MISSING_CONFIGURATION","errorMessage":"Project path is required","messagePattern":"Project path is required","errorType":"error_code","errorClass":"TaskMasterError","httpStatus":null,"severity":"error","filePath":"packages/tm-core/src/tm-core.ts","lineNumber":140,"sourceCode":"\t *\n\t * @param options - Configuration options\n\t * @returns Fully initialized TmCore instance\n\t */\n\tstatic async create(options: TmCoreOptions): Promise<TmCore> {\n\t\tconst instance = new TmCore(options);\n\t\tawait instance.initialize();\n\t\treturn instance;\n\t}\n\n\tprivate _options: TmCoreOptions;\n\n\t/**\n\t * Private constructor - use TmCore.create() instead\n\t * This ensures TmCore is always properly initialized\n\t */\n\tprivate constructor(options: TmCoreOptions) {\n\t\tif (!options.projectPath) {\n\t\t\tthrow new TaskMasterError(\n\t\t\t\t'Project path is required',\n\t\t\t\tERROR_CODES.MISSING_CONFIGURATION\n\t\t\t);\n\t\t}\n\n\t\t// Validate that projectPath is absolute\n\t\tif (!path.isAbsolute(options.projectPath)) {\n\t\t\tthrow new TaskMasterError(\n\t\t\t\t`Project path must be an absolute path, received: \"${options.projectPath}\"`,\n\t\t\t\tERROR_CODES.INVALID_INPUT\n\t\t\t);\n\t\t}\n\n\t\t// Normalize the path\n\t\tthis._projectPath = path.resolve(options.projectPath);\n\t\tthis._options = options;\n\t\t// Domain facades will be initialized in initialize()\n\t}","sourceCodeStart":122,"sourceCodeEnd":158,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/packages/tm-core/src/tm-core.ts#L122-L158","documentation":"TmCore's constructor validates that TmCoreOptions.projectPath is provided. Since TmCore.create() funnels into this private constructor, any instantiation without a projectPath immediately fails with a TaskMasterError code MISSING_CONFIGURATION. This guarantees the facade never operates without a project root.","triggerScenarios":"Calling TmCore.create({}) or TmCore.create({ projectPath: undefined }) — omitting projectPath or passing an empty string/null.","commonSituations":"Reading the path from config/env (e.g. process.cwd() or an option object) that ends up undefined, spreading options where the key is missing, or calling create() with no arguments at all.","solutions":["Pass an explicit projectPath: TmCore.create({ projectPath: process.cwd() }) or the absolute path to the target project.","Verify the variable supplying projectPath is actually defined (console.log it before create()).","If loading from config, add a default or fail fast with a clear CLI message when the path is absent."],"exampleFix":"// before\nconst tmCore = await TmCore.create({ projectPath: options.dir }); // options.dir undefined\n// after\nconst projectPath = options.dir ?? process.cwd();\nconst tmCore = await TmCore.create({ projectPath });","handlingStrategy":"validation","validationCode":"function assertProjectPath(p) {\n  if (typeof p !== 'string' || p.length === 0) throw new Error('projectPath is required for TmCore.create()');\n  return p;\n}\nconst tmCore = await TmCore.create({ projectPath: assertProjectPath(opts.projectPath ?? process.cwd()) });","typeGuard":"function hasProjectPath(o) {\n  return typeof o === 'object' && o !== null && typeof o.projectPath === 'string' && o.projectPath.length > 0;\n}","tryCatchPattern":"try {\n  const tmCore = await TmCore.create(options);\n} catch (e) {\n  if (e instanceof TaskMasterError && e.code === 'MISSING_CONFIGURATION') {\n    console.error('Usage: provide --path <absolute project path>');\n  } else throw e;\n}","preventionTips":["Always pass projectPath explicitly; default to process.cwd() when absent.","Validate options objects at CLI entry points before calling create().","Never build TmCoreOptions by spreading possibly-empty user config without defaults."],"tags":["configuration","initialization","validation"],"backgroundTag":"missing-required-option","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}