siyuan-note/siyuan · error
Invalid shortcut configuration
Error message
Invalid shortcut configuration
What it means
Generic validation guard in systemConfigCollections: a persisted uiLayout entry fails the structural type checks (unknown instance name, invalid Dock type, malformed Search config), so the stored layout is corrupt or was written by an incompatible version and is rejected before being applied.
Solutions
- Reset the UI layout from 设置 - 外观 or remove the stored uiLayout entry from workspace layout config
- Restore layout.json from backup
- Align the SiYuan version with the one that wrote the layout
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at app/src/config/systemConfig.ts:159 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of siyuan-note/siyuan@9f775e8a12 (2026-09-19).
Data as JSON: /api/errors/5c471e04e6eb31af.
Report an issue: GitHub.
Appendix: source
Thrown at app/src/config/systemConfig.ts:159
return value.resize == null || value.resize === "tb" || value.resize === "lr";
}
if (value.instance === "Backlink" || value.instance === "Outline") {
return value.type == null || value.type === "pin" || value.type === "local";
}
if (value.instance === "Graph") {
return value.type == null || value.type === "pin" || value.type === "local" || value.type === "global";
}
if (value.instance === "Search") {
return isSearchConfig(value.config);
}
return typeof value.instance === "string" && ["Tab", "Editor", "Asset", "Custom", "Bookmark", "Files", "Tag"].includes(value.instance);
};
export const systemConfigCollections = (value: Pick<SystemAppConf, "keymap" | "uiLayout">,
defaultLayout?: () => Config.IUiLayout): Pick<Config.IConf, "keymap" | "uiLayout"> => {
const keymap = isObject(value.keymap) ? repairFalsyKeymapGroups(value.keymap) : value.keymap;
if (!isKeymap(keymap)) {
throw new Error("Invalid shortcut configuration");
}
const uiLayout = defaultLayout && (!isObject(value.uiLayout) || !value.uiLayout.left) ? defaultLayout() : value.uiLayout;
if (!isUILayout(uiLayout)) {
throw new Error("Invalid dock configuration");
}
return {keymap, uiLayout};
};
export const systemConfig = (value: SystemAppConf, defaultLayout?: () => Config.IUiLayout): Config.IConf =>
({...value, ...systemConfigCollections(value, defaultLayout)});
View on GitHub (pinned to 9f775e8a12)