eyaltoledano/claude-task-master · error · TaskMasterError

MISSING_CONFIGURATION

MISSING_CONFIGURATION

Error message

Project path is required

What it means

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.

Source

Thrown at packages/tm-core/src/tm-core.ts:140

	 *
	 * @param options - Configuration options
	 * @returns Fully initialized TmCore instance
	 */
	static async create(options: TmCoreOptions): Promise<TmCore> {
		const instance = new TmCore(options);
		await instance.initialize();
		return instance;
	}

	private _options: TmCoreOptions;

	/**
	 * Private constructor - use TmCore.create() instead
	 * This ensures TmCore is always properly initialized
	 */
	private constructor(options: TmCoreOptions) {
		if (!options.projectPath) {
			throw new TaskMasterError(
				'Project path is required',
				ERROR_CODES.MISSING_CONFIGURATION
			);
		}

		// Validate that projectPath is absolute
		if (!path.isAbsolute(options.projectPath)) {
			throw new TaskMasterError(
				`Project path must be an absolute path, received: "${options.projectPath}"`,
				ERROR_CODES.INVALID_INPUT
			);
		}

		// Normalize the path
		this._projectPath = path.resolve(options.projectPath);
		this._options = options;
		// Domain facades will be initialized in initialize()
	}

View on GitHub (pinned to c0c98d367c)

Solutions

  1. Pass an explicit projectPath: TmCore.create({ projectPath: process.cwd() }) or the absolute path to the target project.
  2. Verify the variable supplying projectPath is actually defined (console.log it before create()).
  3. If loading from config, add a default or fail fast with a clear CLI message when the path is absent.

Example fix

// before
const tmCore = await TmCore.create({ projectPath: options.dir }); // options.dir undefined
// after
const projectPath = options.dir ?? process.cwd();
const tmCore = await TmCore.create({ projectPath });
Defensive patterns

Strategy: validation

Validate before calling

function assertProjectPath(p) {
  if (typeof p !== 'string' || p.length === 0) throw new Error('projectPath is required for TmCore.create()');
  return p;
}
const tmCore = await TmCore.create({ projectPath: assertProjectPath(opts.projectPath ?? process.cwd()) });

Type guard

function hasProjectPath(o) {
  return typeof o === 'object' && o !== null && typeof o.projectPath === 'string' && o.projectPath.length > 0;
}

Try / catch

try {
  const tmCore = await TmCore.create(options);
} catch (e) {
  if (e instanceof TaskMasterError && e.code === 'MISSING_CONFIGURATION') {
    console.error('Usage: provide --path <absolute project path>');
  } else throw e;
}

Prevention

When it happens

Trigger: Calling TmCore.create({}) or TmCore.create({ projectPath: undefined }) — omitting projectPath or passing an empty string/null.

Common situations: 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.

Related errors


AI-assisted analysis of eyaltoledano/claude-task-master@c0c98d367c (2026-08-29). Data as JSON: /api/errors/051e488d974cbd78. Report an issue: GitHub.