eyaltoledano/claude-task-master · critical · TaskMasterError
INTERNAL_ERROR
INTERNAL_ERROR
Error message
Failed to initialize TmCore
What it means
A wrapper error thrown when TmCore.initialize() fails for any internal reason (dependency construction, service wiring, config loading, etc.). The original error is attached as the `cause` and the failure is logged via the configured logger, so the outer TaskMasterError (code INTERNAL_ERROR) is generic while the root cause lives on the error object.
Source
Thrown at packages/tm-core/src/tm-core.ts:201
this._integration = new IntegrationDomain(this._configManager);
this._loop = new LoopDomain(this._configManager);
// Initialize domains that need async setup
await this._tasks.initialize();
// Wire up cross-domain dependencies
// WorkflowDomain needs TasksDomain for status updates
this._workflow.setTasksDomain(this._tasks);
// Log successful initialization
this._logger.info('TmCore initialized successfully');
} catch (error) {
// Log error if logger is available
if (this._logger) {
this._logger.error('Failed to initialize TmCore:', error);
}
throw new TaskMasterError(
'Failed to initialize TmCore',
ERROR_CODES.INTERNAL_ERROR,
{ operation: 'initialize' },
error as Error
);
}
}
/**
* Get project root path
*/
get projectPath(): string {
return this._projectPath;
}
/**
* Close and cleanup resources
* Releases file locks and other storage resourcesView on GitHub (pinned to c0c98d367c)
Solutions
- Inspect error.cause (the 4th TaskMasterError arg) and the logger output ('Failed to initialize TmCore:') for the real root cause.
- Verify the project directory and its Task Master config files are readable and valid.
- Check that any custom options/adapters passed to TmCore.create() are valid instances.
- Reproduce with a minimal TmCore.create({ projectPath }) call to isolate the failing subsystem, then upgrade or file an issue if it's a library bug.
Example fix
// before
try { const tm = await TmCore.create(opts); } catch (e) { console.log(e.message); } // generic only
// after
try { const tm = await TmCore.create(opts); }
catch (e) {
console.error(e.message, e.cause ?? e); // root cause of init failure
} Defensive patterns
Strategy: try-catch
Try / catch
import { TaskMasterError } from '@tm/core';
try {
const tmCore = await TmCore.create({ projectPath });
} catch (e) {
if (e instanceof TaskMasterError && e.code === 'INTERNAL_ERROR') {
console.error('TmCore init failed:', e.cause ?? e); // surface root cause
} else throw e;
} Prevention
- Always inspect error.cause on TaskMasterError for the real failure.
- Enable the TmCore logger so init failures are logged with detail.
- Keep project config files valid and readable; test TmCore.create() early in app startup.
- Pin tm-core versions and read upgrade notes for changed init requirements.
When it happens
Trigger: Any exception inside initialize()'s try block — e.g. a domain service constructor throws, config files are unreadable, or a module dependency fails to instantiate during TmCore.create().
Common situations: Corrupt or missing project config, filesystem permission problems, a broken custom adapter/service injected via options, or bugs in a newly upgraded tm-core version.
Related errors
- INTERNAL_ERROR
- Tasks file not found - initialize project first
- Tag ${tag} not found - file doesn't exist
- NOT_FOUND
- MISSING_CONFIGURATION
AI-assisted analysis of eyaltoledano/claude-task-master@c0c98d367c (2026-08-29).
Data as JSON: /api/errors/ab7784aa92400998.
Report an issue: GitHub.