earendil-works/pi · error · Error
Failed to parse theme ${label}: ${error}
Error message
Failed to parse theme ${label}: ${error} What it means
Error "Failed to parse theme ${label}: ${error}" thrown in earendil-works/pi.
Source
Thrown at packages/coding-agent/src/modes/interactive/theme/theme.ts:602
}
if (otherErrors.length > 0) {
errorMessage += `\n\nOther errors:\n${otherErrors.join("\n")}`;
}
throw new Error(errorMessage);
}
const themeJson = json as ThemeJson;
assertThemeNameIsValid(themeJson.name);
return themeJson;
}
function parseThemeJsonContent(label: string, content: string): ThemeJson {
let json: unknown;
try {
json = JSON.parse(stripBom(content));
} catch (error) {
throw new Error(`Failed to parse theme ${label}: ${error}`);
}
return parseThemeJson(label, json);
}
function loadThemeJson(name: string): ThemeJson {
const builtinThemes = getBuiltinThemes();
if (name in builtinThemes) {
return builtinThemes[name];
}
const registeredTheme = registeredThemes.get(name);
if (registeredTheme?.sourcePath) {
const content = fs.readFileSync(registeredTheme.sourcePath, "utf-8");
return parseThemeJsonContent(registeredTheme.sourcePath, content);
}
if (registeredTheme) {
throw new Error(`Theme "${name}" does not have a source path for export`);
}
const customThemesDir = getCustomThemesDir();View on GitHub (pinned to 4af9d21d3b)
When it happens
Trigger: Thrown at packages/coding-agent/src/modes/interactive/theme/theme.ts:602 when the library encounters an invalid state.
Common situations: See trigger scenarios.
Understand the failure class
- Parsing and encoding errors: unexpected token, malformed input — why parsers reject input and how to find the real culprit.
AI-assisted analysis of earendil-works/pi@4af9d21d3b (2026-08-24).
Data as JSON: /api/errors/c6b9402c5116e923.
Report an issue: GitHub.