{"record":{"id":"ffed8d4b5dfa112a","repo":"ramensoftware/windhawk","slug":"mods-load-failed","errorCode":"MODS_LOAD_FAILED","errorMessage":"${loadErrors.length} mod(s) could not be loaded. ${loadErrors.map(({ modId, error }) => error ? `${modId}: ${error}` : modId).join('; ')}","messagePattern":"(.+?) mod\\(s\\) could not be loaded\\. (.+?)\\) => error \\? `(.+?): (.+?)` : modId\\)\\.join\\('; '\\)\\}","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/windhawk-vscode/src/extension.ts","lineNumber":587,"sourceCode":"\t\t},\n\t\tgetInstalledMods: async message => {\n\t\t\tconst installedMods: GetInstalledModsReplyData['installedMods'] = {};\n\t\t\t// Says the listing is short of the machine, so a reader that needs the\n\t\t\t// complete set of ids does not read the map as the answer. The native\n\t\t\t// notifications below are for the user; this is for the webview.\n\t\t\tlet listingError: WireError | undefined;\n\t\t\ttry {\n\t\t\t\tconst { mods, loadErrors } = await this._utils.core.listInstalledMods({\n\t\t\t\t\tlanguage: this._language,\n\t\t\t\t\tcheckForUpdates: this._checkForUpdates,\n\t\t\t\t\tsyncProfile: true,\n\t\t\t\t});\n\t\t\t\tfor (const { modId, error } of loadErrors) {\n\t\t\t\t\tvscode.window.showErrorMessage(`Failed to load mod ${modId}: ${error}`);\n\t\t\t\t}\n\t\t\t\tif (loadErrors.length > 0) {\n\t\t\t\t\tlistingError = {\n\t\t\t\t\t\tcode: 'MODS_LOAD_FAILED',\n\t\t\t\t\t\tmessage: `${loadErrors.length} mod(s) could not be loaded. ` +\n\t\t\t\t\t\t\tloadErrors.map(({ modId, error }) =>\n\t\t\t\t\t\t\t\terror ? `${modId}: ${error}` : modId).join('; ')\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\t// The core entry IS this reply's entry - both carry the terms of the\n\t\t\t\t// update answer and neither the answer - so the whole thing rides\n\t\t\t\t// through, a field the core adds included.\n\t\t\t\tfor (const [modId, entry] of Object.entries(mods)) {\n\t\t\t\t\tinstalledMods[modId] = entry;\n\t\t\t\t}\n\t\t\t} catch (e) {\n\t\t\t\treportException(e);\n\t\t\t\tlistingError = {\n\t\t\t\t\tcode: 'INTERNAL',\n\t\t\t\t\tmessage: e instanceof Error ? e.message : String(e)\n\t\t\t\t};\n\t\t\t}","sourceCodeStart":569,"sourceCodeEnd":605,"githubUrl":"https://github.com/ramensoftware/windhawk/blob/61d99ed8e182e1af1b60109612b6763ad1b4b74e/src/windhawk-vscode/src/extension.ts#L569-L605","documentation":"Aggregated listing failure in WindhawkPanel. When one or more installed mods fail to load, each failure is surfaced individually with showErrorMessage, and the getInstalledMods reply also carries a MODS_LOAD_FAILED error summarizing the count and per-mod reasons.","triggerScenarios":"InstalledModsProvider.loadInstalledMods returns loadErrors (per-mod errors from the backend, e.g. a mod's metadata could not be parsed or the engine failed to load it), and loadErrors.length > 0 when building the installed-mods reply.","commonSituations":"Corrupted mod installation files; mods written by incompatible Windhawk versions; locally-built mods with invalid metadata sitting in the mods directory.","solutions":["Read the per-mod messages in the aggregated error (modId: error) and fix the specific mods listed.","Rebuild or reinstall the failing mods; validate their .wh.cpp metadata blocks.","If a mod is unneeded, remove its files from the mods directory so it stops failing to load."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":"const reply = await webviewIPC.getInstalledMods();\nif (reply.error?.code === 'MODS_LOAD_FAILED') {\n  const failing = reply.error.message.split('; ');\n  console.error('Mods failing to load:', failing);\n}","typeGuard":"const hasLoadErrors = (r: { error?: { code: string } }): boolean =>\n  r.error?.code === 'MODS_LOAD_FAILED';","tryCatchPattern":"try {\n  const listing = await loadInstalledMods();\n  if (listing.error?.code === 'MODS_LOAD_FAILED') {\n    listing.error.message.split(';').forEach(showPerModWarning);\n  }\n} catch (e) {\n  console.error(e);\n}","preventionTips":["Keep mod .wh.cpp metadata valid; run the mod through Windhawk compile before installing.","Remove or repair mods flagged by the per-mod 'Failed to load mod <id>' toasts promptly.","After Windhawk version upgrades, verify installed mods still load (metadata schema may change)."],"tags":["mod-loading","aggregated-errors","vscode-extension"],"backgroundTag":"unexpected-response-shape","analyzedSha":"61d99ed8e182e1af1b60109612b6763ad1b4b74e","analyzedAt":"2026-09-12T14:02:41.115Z","contentChangedAt":"2026-09-12T14:02:41.115Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}