windmill-labs/windmill · warning

Argument not found!

Error message

Argument not found!

What it means

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.

Source

Thrown at frontend/src/lib/components/schema/AddProperty.svelte:152

				} else {
					throw Error('Nested argument not found!')
				}
			})

			if (Object.keys(modifiedProperties).includes(argName)) {
				delete modifiedProperties[argName]

				if (modifiedObject.required) {
					modifiedObject.required = schema.required.filter((arg) => arg !== argName)
				}
				if (modifiedObject.order) {
					modifiedObject.order = modifiedObject.order.filter((arg) => arg !== argName)
				}
				schema = modifiedObject
				schemaString = JSON.stringify(schema, null, '\t')
				dispatch('change', schema)
			} else {
				throw Error('Argument not found!')
			}
			dispatch('change', schema)
		} catch (err) {
			sendUserToast(`Could not delete argument: ${err}`, true)
		}
	}
</script>

<div class="flex">
	<AddPropertyForm
		on:add={(e) => {
			try {
				handleAddOrEditArgument({
					...DEFAULT_PROPERTY,
					selectedType: 'string',
					name: e.detail.name
				})
			} catch (err) {

View on GitHub (pinned to e474e8803c)

Solutions

  1. Reload/refresh the editor so the schema is current, then delete again
  2. Verify the argument name matches exactly (case-sensitive) in the schema
  3. Edit the schema JSON directly to remove the property
  4. Avoid duplicate delete dispatches (disable button after first click)

Example fix

// before
if (Object.keys(modifiedProperties).includes(argName)) { delete modifiedProperties[argName]; }
// after: guard against double-delete
if (Object.keys(modifiedProperties).includes(argName)) {
  delete modifiedProperties[argName];
} else if (!isAlreadyDeleted) { throw Error('Argument not found!'); }
Defensive patterns

Strategy: validation

Validate before calling

if (!schema.properties || !(argName in schema.properties)) {
  console.warn(`Argument "${argName}" already gone — skipping delete`);
  return;
}

Type guard

function argumentExists(schema: any, argName: string): boolean {
  return !!schema?.properties && Object.prototype.hasOwnProperty.call(schema.properties, argName);
}

Try / catch

try { await handleDeleteArgument(argName); } catch (e) {
  if (/Argument not found/.test(String(e))) showInfo('Argument already removed');
  else throw e;
}

Prevention

When it happens

Trigger: 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.

Common situations: 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.

Related errors


AI-assisted analysis of windmill-labs/windmill@e474e8803c (2026-09-03). Data as JSON: /api/errors/0ecfda50a1c713b7. Report an issue: GitHub.