{"record":{"id":"fd6df1f4bfeabf74","repo":"ramensoftware/windhawk","slug":"no-mod-is-being-edited","errorCode":null,"errorMessage":"No mod is being edited","messagePattern":"No mod is being edited","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/windhawk-vscode/src/extension.ts","lineNumber":1674,"sourceCode":"\t\t\t});\n\t\t},\n\t\tgetInitialSidebarParams: async message => {\n\t\t\t// The catch belongs here, not in _postEditedModDetails: the other\n\t\t\t// caller (setEditedMod) must keep propagating failures so the\n\t\t\t// enter-editor-mode flows abort like they always did.\n\t\t\ttry {\n\t\t\t\tawait this._postEditedModDetails();\n\t\t\t} catch (e) {\n\t\t\t\treportException(e);\n\t\t\t}\n\t\t},\n\t\tenableEditedMod: async message => {\n\t\t\tconst data: EnableEditedModData = message.data;\n\n\t\t\tlet succeeded = false;\n\t\t\ttry {\n\t\t\t\tif (!this._editedModId) {\n\t\t\t\t\tthrow new Error('No mod is being edited');\n\t\t\t\t}\n\n\t\t\t\t// The edited mod is always local@, for which setModEnabled is\n\t\t\t\t// exactly the raw config write (no profile bookkeeping).\n\t\t\t\tconst localModId = 'local@' + this._editedModId;\n\t\t\t\tawait this._utils.core.setModEnabled(localModId, data.enable);\n\n\t\t\t\t// The preview shows the mod's config, which this write moved.\n\t\t\t\tWindhawkPanel.reloadInstalledMods();\n\n\t\t\t\tsucceeded = true;\n\t\t\t} catch (e) {\n\t\t\t\treportException(e);\n\t\t\t}\n\n\t\t\twebviewIPC.enableEditedModReply(this._view?.webview, message.messageId, {\n\t\t\t\tenabled: data.enable,\n\t\t\t\tsucceeded","sourceCodeStart":1656,"sourceCodeEnd":1692,"githubUrl":"https://github.com/ramensoftware/windhawk/blob/61d99ed8e182e1af1b60109612b6763ad1b4b74e/src/windhawk-vscode/src/extension.ts#L1656-L1692","documentation":"Sentinel guard inside the enableEditedMod IPC handler: it fires when this._editedModId is falsy (empty/undefined), meaning the editor sidebar received an enable/disable request while no mod was ever opened in editor mode (or editor state was cleared), so there is no 'local@<id>' mod to toggle. The generic message is the state check failing, not a mod problem.","triggerScenarios":"Thrown at src/windhawk-vscode/src/extension.ts:1674 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Open a mod in the editor (setEditedMod) before toggling enable/disable so _editedModId is populated","If it fires spuriously, re-sync editor state between webview and extension (e.g. after a reload or editor-mode exit) before retrying the request","Wrap the toggle action client-side so the button is disabled when no mod is being edited"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}