ramensoftware/windhawk · error

No mod is being edited

Error message

No mod is being edited

What it means

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.

Solutions

  1. Open a mod in the editor (setEditedMod) before toggling enable/disable so _editedModId is populated
  2. 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
  3. Wrap the toggle action client-side so the button is disabled when no mod is being edited
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/windhawk-vscode/src/extension.ts:1674 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of ramensoftware/windhawk@61d99ed8e1 (2026-09-12). Data as JSON: /api/errors/fd6df1f4bfeabf74. Report an issue: GitHub.

Appendix: source

Thrown at src/windhawk-vscode/src/extension.ts:1674

			});
		},
		getInitialSidebarParams: async message => {
			// The catch belongs here, not in _postEditedModDetails: the other
			// caller (setEditedMod) must keep propagating failures so the
			// enter-editor-mode flows abort like they always did.
			try {
				await this._postEditedModDetails();
			} catch (e) {
				reportException(e);
			}
		},
		enableEditedMod: async message => {
			const data: EnableEditedModData = message.data;

			let succeeded = false;
			try {
				if (!this._editedModId) {
					throw new Error('No mod is being edited');
				}

				// The edited mod is always local@, for which setModEnabled is
				// exactly the raw config write (no profile bookkeeping).
				const localModId = 'local@' + this._editedModId;
				await this._utils.core.setModEnabled(localModId, data.enable);

				// The preview shows the mod's config, which this write moved.
				WindhawkPanel.reloadInstalledMods();

				succeeded = true;
			} catch (e) {
				reportException(e);
			}

			webviewIPC.enableEditedModReply(this._view?.webview, message.messageId, {
				enabled: data.enable,
				succeeded

View on GitHub (pinned to 61d99ed8e1)