{"record":{"id":"87687a3e16c0460c","repo":"windmill-labs/windmill","slug":"argument-not-found-87687a","errorCode":null,"errorMessage":"Argument not found!","messagePattern":"Argument not found!","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"warning","filePath":"frontend/src/lib/components/schema/AddPropertyV2.svelte","lineNumber":143,"sourceCode":"\t\t\t\tif (Object.keys(modifiedProperties).includes(property)) {\n\t\t\t\t\tmodifiedObject = modifiedProperties[property]\n\t\t\t\t\tmodifiedProperties = modifiedObject.properties as object\n\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} else {\n\t\t\t\tthrow Error('Argument not found!')\n\t\t\t}\n\t\t\tsyncOrders(modifiedObject)\n\t\t\tschema = $state.snapshot(modifiedObject)\n\t\t} catch (err) {\n\t\t\tsendUserToast(`Could not delete argument: ${err}`, true)\n\t\t}\n\t}\n\n\tconst trigger_render = $derived(trigger)\n</script>\n\n<AddPropertyFormV2\n\t{noPopover}\n\ton:add={(e) => {\n\t\ttry {\n\t\t\thandleAddOrEditArgument({\n\t\t\t\t...DEFAULT_PROPERTY,\n\t\t\t\tselectedType: 'string',","sourceCodeStart":125,"sourceCodeEnd":161,"githubUrl":"https://github.com/windmill-labs/windmill/blob/e474e8803ce2ff5c2df09a58dab51d45f5c922ca/frontend/src/lib/components/schema/AddPropertyV2.svelte#L125-L161","documentation":"In AddPropertyV2.svelte, once the nested path is resolved, the top-level check confirms the argument exists in `modifiedProperties` before deleting it and cleaning up required/order arrays. Missing argument throws this error, caught and surfaced as a toast.","triggerScenarios":"Target argument is absent from the resolved properties object at delete time — duplicate delete dispatch, renamed argument, or outdated schema snapshot.","commonSituations":"Rapid delete clicks, rename-then-delete with the old name, or schema synced from server after another user removed the argument.","solutions":["Refresh the editor and retry the deletion","Check exact argument spelling against the schema JSON","Delete via direct JSON edit if UI state is inconsistent","Debounce/disable the delete button to prevent duplicate dispatches"],"exampleFix":"// before\nif (Object.keys(modifiedProperties).includes(argName)) { /* delete */ } else { throw Error('Argument not found!'); }\n// after: idempotent delete\nif (Object.keys(modifiedProperties).includes(argName)) { /* delete + syncOrders */ }","handlingStrategy":"validation","validationCode":"if (!modifiedObject?.properties || !(argName in modifiedObject.properties)) {\n  console.warn(`Argument \"${argName}\" not present — nothing to delete`);\n  return;\n}","typeGuard":"function canDelete(obj: any, argName: string): obj is { properties: Record<string, unknown>; required?: string[]; order?: string[] } {\n  return !!obj?.properties && Object.prototype.hasOwnProperty.call(obj.properties, argName);\n}","tryCatchPattern":"try { await handleDeleteArgument(argName); } catch (e) {\n  if (/Argument not found/.test(String(e))) showInfo('Already removed');\n  else throw e;\n}","preventionTips":["Make deletes idempotent with an existence check","Debounce delete dispatches","Sync schema from server before destructive edits in collaborative settings"],"tags":["schema","ui","delete","svelte5"],"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"}