continuedev/continue · error · Error
Failed to load config
Error message
Failed to load config
What it means
The streamDiffLines handler loads config to resolve a model for streaming a diff; if loadConfig returns no config object (parse failure, missing file, or error swallowed into undefined) it throws 'Failed to load config'.
Source
Thrown at core/core.ts:743
on("nextEdit/queue/clear", async (msg) => {
console.log("nextEdit/queue/clear");
const queue = PrefetchQueue.getInstance();
queue.clear();
return;
});
on("nextEdit/queue/abort", async (msg) => {
console.log("nextEdit/queue/abort");
const queue = PrefetchQueue.getInstance();
queue.abort();
return;
});
on("streamDiffLines", async (msg) => {
const { config } = await this.configHandler.loadConfig();
if (!config) {
throw new Error("Failed to load config");
}
const { data } = msg;
// Title can be an edit, chat, or apply model
// Fall back to chat
const llm =
config.modelsByRole.edit.find((m) => m.title === data.modelTitle) ??
config.modelsByRole.apply.find((m) => m.title === data.modelTitle) ??
config.modelsByRole.chat.find((m) => m.title === data.modelTitle) ??
config.selectedModelByRole.chat;
if (!llm) {
throw new Error("No model selected");
}
const abortManager = ApplyAbortManager.getInstance();
const abortController = abortManager.get(View on GitHub (pinned to 5522c6f44c)
Solutions
- Fix or regenerate config.json (check JSON syntax)
- Check that loadConfig errors are surfaced, not silently returning undefined
- Restore a known-good config backup
Defensive patterns
Strategy: validation
Validate before calling
const { config, error } = await configHandler.loadConfig();
if (!config) { surface(error ?? 'config.json missing/invalid'); return; } Type guard
const isConfig = (c: unknown): c is Config => !!c && typeof c === 'object' && 'modelsByRole' in c;
Try / catch
catch (e) { if (e.message === 'Failed to load config') { revalidateConfigFile(); } } Prevention
- Validate config.json (JSON.parse + schema) at startup
- Back up config before migrations
When it happens
Trigger: Requesting streamDiffLines when config.json is missing, unparsable, or loadConfig returned an error result with config undefined.
Common situations: Corrupted or hand-edited config.json; deleted config directory; schema change after upgrade invalidating old config.
Related errors
- No chat model selected
- No model selected
- Profile ${profileId} not found
- No reranker set up
- Only rule files can be deleted
AI-assisted analysis of continuedev/continue@5522c6f44c (2026-08-27).
Data as JSON: /api/errors/1c5cf46c4ba0acec.
Report an issue: GitHub.