vercel/turborepo · error · Error
Invalid task name found in turbo.json.
Error message
Invalid task name found in turbo.json.
What it means
The eslint-plugin-turbo calculates task inputs by parsing task names from turbo.json. getTaskAddress splits each task key into an optional workspace name and a script name. It throws this Error when a task name is an empty string, because an empty key cannot address any task.
Solutions
- Open turbo.json, find the empty task key, and remove it
- If the file is generated, fix the generator so it skips empty task names
- Run ESLint again after saving the corrected file
Example fix
// before: turbo.json
{ "tasks": { "": { "outputs": ["dist/**"] } } }
// after: turbo.json
{ "tasks": { "build": { "outputs": ["dist/**"] } } } Defensive patterns
Strategy: validation
Validate before calling
// scan turbo.json for empty task keys before running eslint-plugin-turbo
import fs from "node:fs";
const config = JSON.parse(fs.readFileSync("turbo.json", "utf8"));
const tasks = config.tasks ?? config.pipeline ?? {};
const emptyKeys = Object.keys(tasks).filter((k) => k.length === 0);
if (emptyKeys.length > 0) {
throw new Error(`Remove empty task keys from turbo.json: ${emptyKeys}`);
} Type guard
function isValidTaskName(name: string): boolean {
return name.length > 0;
} Prevention
- Validate turbo.json keys in a pre-commit hook or CI lint step
- Never generate task keys from unfiltered lists that may contain empty strings
- Review diffs of turbo.json for stray empty keys after codemods
When it happens
Trigger: A turbo.json contains an empty string as a task key, for example "tasks": { "": { ... } }. An empty segment can also appear when a key is produced by string splitting or config merging that yields an empty entry. getTaskAddress receives a zero-length taskName and throws.
Common situations: Hand-editing turbo.json and leaving an empty key. A codemod or script that generates task keys from a list with empty values. YAML to JSON conversion that turns a null key into an empty string.
Related errors
- May not specify workspace name in non-root turbo.json
- {warning}
- Directory path contains potentially unsafe characters
- Found both turbo.json and turbo.jsonc in the same directory
- Found both turbo.json and turbo.jsonc in the same directory
AI-assisted analysis of vercel/turborepo@f9245100cf (2026-08-17).
Data as JSON: /api/errors/243cbd9513bc5b78.
Report an issue: GitHub.
Appendix: source
Thrown at packages/eslint-plugin-turbo/lib/utils/calculate-inputs.ts:232
function environmentTestArray(envContext: EnvironmentTest) {
return [
envContext.legacyConfig,
envContext.env,
envContext.passThroughEnv,
envContext.dotEnv
];
}
// Identify where to store `EnvironmentConfig`s
function getTaskAddress(taskName: string): {
workspaceName: string | null;
scriptName: string;
} {
// Somehow empty. Error.
if (taskName.length === 0) {
throw new Error("Invalid task name found in turbo.json.");
}
const firstIndexOf = taskName.indexOf("#");
// Something like "build"
if (firstIndexOf === -1) {
return {
workspaceName: null,
scriptName: taskName
};
}
// Something like "what#are#you#doing"
if (firstIndexOf !== taskName.lastIndexOf("#")) {
throw new Error("Invalid task name found in turbo.json.");
}
const [workspaceName, scriptName] = taskName.split("#");View on GitHub (pinned to f9245100cf)