{"record":{"id":"a9c8ef875a2cf335","repo":"ramensoftware/windhawk","slug":"mod-id-specified-in-the-source-code-already-exists","errorCode":null,"errorMessage":"Mod id specified in the source code already exists","messagePattern":"Mod id specified in the source code already exists","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"src/windhawk-vscode/src/extension.ts","lineNumber":1763,"sourceCode":"\t\t\t\t\tthrow new Error('No mod is being edited');\n\t\t\t\t}\n\n\t\t\t\tconst oldModId = this._editedModId;\n\t\t\t\tconst localOldModId = 'local@' + this._editedModId;\n\n\t\t\t\tconst modSource = readModSource(this._utils.editorWorkspace);\n\n\t\t\t\tconst metadata = await extractMetadataOrThrow(this._utils.core, modSource, this._language);\n\t\t\t\tif (!metadata.id) {\n\t\t\t\t\tthrow new Error('Mod id must be specified in the source code');\n\t\t\t\t}\n\n\t\t\t\tconst modId = metadata.id;\n\t\t\t\tconst localModId = 'local@' + modId;\n\n\t\t\t\tif (modId !== oldModId) {\n\t\t\t\t\tif (await this._utils.core.doesModExist(localModId)) {\n\t\t\t\t\t\tthrow new Error('Mod id specified in the source code already exists');\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst compileOp = this._utils.core.installMod({\n\t\t\t\t\tstorageId: localModId,\n\t\t\t\t\tsource: modSource,\n\t\t\t\t\tmetadata,\n\t\t\t\t\tdisabled: data.disabled,\n\t\t\t\t\tloggingEnabled: data.loggingEnabled,\n\t\t\t\t\tcompileLocally: true,\n\t\t\t\t\ttrackInProfile: false,\n\t\t\t\t\tpchFolder: this._utils.editorWorkspace.getWorkspaceFolder(),\n\t\t\t\t\trenameFromStorageId: modId !== oldModId ? localOldModId : undefined,\n\t\t\t\t});\n\t\t\t\tthis._currentCompileOp = compileOp;\n\t\t\t\tconst result = await compileOp.result;\n\n\t\t\t\tif (modId !== oldModId) {","sourceCodeStart":1745,"sourceCodeEnd":1781,"githubUrl":"https://github.com/ramensoftware/windhawk/blob/61d99ed8e182e1af1b60109612b6763ad1b4b74e/src/windhawk-vscode/src/extension.ts#L1745-L1781","documentation":"Validation guard in compileEditedMod: after extracting metadata from the mod source, the mod's id differs from the currently edited mod's id (a rename), and a mod with the new id already exists in storage as 'local@<newId>'. Installing would collide with that existing mod, so the compile aborts instead of overwriting an unrelated mod.","triggerScenarios":"Thrown at src/windhawk-vscode/src/extension.ts:1763 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Change the id in the mod's metadata ([Mod id = ...]) to one not already installed, or revert it to the original edited mod id if the rename was accidental","Uninstall or rename the existing local@<newId> mod in Windhawk first, then recompile","Keep the original id if the intent was to update the same mod rather than create a distinct one"],"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"}