{"record":{"id":"0ecfda50a1c713b7","repo":"windmill-labs/windmill","slug":"argument-not-found","errorCode":null,"errorMessage":"Argument not found!","messagePattern":"Argument not found!","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"frontend/src/lib/components/schema/AddProperty.svelte","lineNumber":152,"sourceCode":"\t\t\t\t} else {\n\t\t\t\t\tthrow Error('Nested argument not found!')\n\t\t\t\t}\n\t\t\t})\n\n\t\t\tif (Object.keys(modifiedProperties).includes(argName)) {\n\t\t\t\tdelete modifiedProperties[argName]\n\n\t\t\t\tif (modifiedObject.required) {\n\t\t\t\t\tmodifiedObject.required = schema.required.filter((arg) => arg !== argName)\n\t\t\t\t}\n\t\t\t\tif (modifiedObject.order) {\n\t\t\t\t\tmodifiedObject.order = modifiedObject.order.filter((arg) => arg !== argName)\n\t\t\t\t}\n\t\t\t\tschema = modifiedObject\n\t\t\t\tschemaString = JSON.stringify(schema, null, '\\t')\n\t\t\t\tdispatch('change', schema)\n\t\t\t} else {\n\t\t\t\tthrow Error('Argument not found!')\n\t\t\t}\n\t\t\tdispatch('change', schema)\n\t\t} catch (err) {\n\t\t\tsendUserToast(`Could not delete argument: ${err}`, true)\n\t\t}\n\t}\n</script>\n\n<div class=\"flex\">\n\t<AddPropertyForm\n\t\ton:add={(e) => {\n\t\t\ttry {\n\t\t\t\thandleAddOrEditArgument({\n\t\t\t\t\t...DEFAULT_PROPERTY,\n\t\t\t\t\tselectedType: 'string',\n\t\t\t\t\tname: e.detail.name\n\t\t\t\t})\n\t\t\t} catch (err) {","sourceCodeStart":134,"sourceCodeEnd":170,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/frontend/src/lib/components/schema/AddProperty.svelte#L134-L170","documentation":"After navigating nested properties, `handleDeleteArgument` in AddProperty.svelte checks that the target argument name exists at the top of the resolved properties. If the argument is not found there, it throws this error; the catch shows a 'Could not delete argument' toast.","triggerScenarios":"The argument name targeted for deletion is absent from `modifiedProperties` — already deleted in another tab, name mismatch after a rename, or the delete was dispatched against an outdated schema snapshot.","commonSituations":"Double-clicking delete (second click finds nothing), renaming an arg then attempting a delete keyed on the old name, or schema replaced externally between load and delete.","solutions":["Reload/refresh the editor so the schema is current, then delete again","Verify the argument name matches exactly (case-sensitive) in the schema","Edit the schema JSON directly to remove the property","Avoid duplicate delete dispatches (disable button after first click)"],"exampleFix":"// before\nif (Object.keys(modifiedProperties).includes(argName)) { delete modifiedProperties[argName]; }\n// after: guard against double-delete\nif (Object.keys(modifiedProperties).includes(argName)) {\n  delete modifiedProperties[argName];\n} else if (!isAlreadyDeleted) { throw Error('Argument not found!'); }","handlingStrategy":"validation","validationCode":"if (!schema.properties || !(argName in schema.properties)) {\n  console.warn(`Argument \"${argName}\" already gone — skipping delete`);\n  return;\n}","typeGuard":"function argumentExists(schema: any, argName: string): boolean {\n  return !!schema?.properties && Object.prototype.hasOwnProperty.call(schema.properties, argName);\n}","tryCatchPattern":"try { await handleDeleteArgument(argName); } catch (e) {\n  if (/Argument not found/.test(String(e))) showInfo('Argument already removed');\n  else throw e;\n}","preventionTips":["Treat delete as idempotent — check existence first","Disable the delete button after the first click to avoid duplicate dispatches","Re-read the schema after renames before deleting by old name"],"tags":["schema","ui","delete"],"backgroundTag":"argument-not-found","analyzedSha":"e474e8803ce2ff5c2df09a58dab51d45f5c922ca","analyzedAt":"2026-09-03T12:38:19.024Z","contentChangedAt":"2026-09-03T12:38:19.024Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}