eyaltoledano/claude-task-master · warning
Invalid value for
Error message
Invalid value for ${mapping.env}: ${value} What it means
environment-config-provider.service.ts maps environment variables to config paths. When a mapped env var has a value but the mapping's optional `validate` predicate rejects it, the provider logs this warning and skips setting the property, leaving the config value at its default.
Solutions
- Read the warning to identify the offending env var and fix its value so it passes the mapping's validate function
- Check the mapping definition to see which env var names have validators and what format they expect
- Remove or unset the env var if you want the built-in default to apply instead
- Add or relax the validator in the config mapping if the rejected value is actually legitimate
Example fix
// before TIMEOUT_MS=soon // after TIMEOUT_MS=30000
Defensive patterns
Strategy: validation
Validate before calling
const raw = process.env.TIMEOUT_MS;
const isValid = raw !== undefined && Number.isFinite(Number(raw));
if (!isValid) console.warn('TIMEOUT_MS must be a number; got', raw); Prevention
- Document each env var's expected format next to its mapping
- Add a startup validation script that checks all mapped env vars
- Use .env.example files with valid sample values
- Watch logs for this warning in CI to catch bad env config early
When it happens
Trigger: Calling loadConfig() while an env var like a timeout or URL has a value that fails the mapping's validator (e.g. non-numeric string for a numeric field, malformed URL).
Common situations: Typo in a numeric env var ('tahirty' instead of '30'), port set to a non-number, empty-but-truthy strings, values copied with units ('500ms' where a plain number is expected), stale .env files after a schema change.
Understand the failure class
Background: "is not a valid" / "Invalid ... value" environment variable errors: how libraries validate env vars and what to do when they reject yours — this error's family across 48 libraries.
Related errors
- Invalid subtask count determined
- Warning: Invalid fallback provider
- All subtasks for task
- All tasks parameter must be an array
- API key environment variable name is required
AI-assisted analysis of eyaltoledano/claude-task-master@c0c98d367c (2026-08-29).
Data as JSON: /api/errors/0aa7ff262a199784.
Report an issue: GitHub.
Appendix: source
Thrown at packages/tm-core/src/modules/config/services/environment-config-provider.service.ts:81
];
}
/**
* Load configuration from environment variables
*/
loadConfig(): PartialConfiguration {
const config: PartialConfiguration = {};
for (const mapping of this.mappings) {
// Skip runtime state variables
if (mapping.isRuntimeState) continue;
const value = process.env[mapping.env];
if (!value) continue;
// Validate value if validator is provided
if (mapping.validate && !mapping.validate(value)) {
this.logger.warn(`Invalid value for ${mapping.env}: ${value}`);
continue;
}
// Set the value in the config object
this.setNestedProperty(config, mapping.path, value);
}
return config;
}
/**
* Get runtime state from environment variables
*/
getRuntimeState(): Record<string, string> {
const state: Record<string, string> = {};
for (const mapping of this.mappings) {
if (!mapping.isRuntimeState) continue;View on GitHub (pinned to c0c98d367c)