dagger/dagger · error

legacy customization object typedef id: %w

Error message

legacy customization object typedef id: %w

What it means

Thrown when ResultIDInput fails to serialize the customized object TypeDef into an ID after applying a legacy customization. It indicates the updated TypeDef could not be converted to its ID representation.

Source

Thrown at core/module.go:762

		}
		if constructor {
			if err := dag.Select(ctx, updatedObjectTypeDef, &updatedObjectTypeDef, dagql.Selector{
				Field: "__withConstructor",
				Args:  []dagql.NamedInput{{Name: "function", Value: fnID}},
			}); err != nil {
				return fmt.Errorf("legacy customization constructor %v: %w", cust.Function, err)
			}
		} else {
			if err := dag.Select(ctx, updatedObjectTypeDef, &updatedObjectTypeDef, dagql.Selector{
				Field: "__withFunction",
				Args:  []dagql.NamedInput{{Name: "function", Value: fnID}},
			}); err != nil {
				return fmt.Errorf("legacy customization function %v: %w", cust.Function, err)
			}
		}
		objectTypeDefID, err := ResultIDInput(updatedObjectTypeDef)
		if err != nil {
			return fmt.Errorf("legacy customization object typedef id: %w", err)
		}
		for i, existing := range mod.ObjectDefs {
			if sameAttachedResult(existing, objDef) {
				if err := dag.Select(ctx, existing, &mod.ObjectDefs[i], dagql.Selector{
					Field: "__withObjectTypeDef",
					Args:  []dagql.NamedInput{{Name: "objectTypeDef", Value: objectTypeDefID}},
				}); err != nil {
					return fmt.Errorf("legacy customization object typedef: %w", err)
				}
				break
			}
		}
	}
	return nil
}

func legacyArgDefaultValue(typeDef *TypeDef, value string) (JSON, bool) {
	if value == "" {

View on GitHub (pinned to 82ba2681db)

Solutions

  1. Check what the legacy customization mutates on the object TypeDef and ensure the resulting TypeDef is well-formed (valid field types, resolvable functions).
  2. Regenerate module codegen so the legacy customization produces a current, encodable TypeDef.
  3. Upgrade the Dagger CLI/engine; older TypeDef shapes may fail ID encoding in newer engines.
  4. Capture the wrapped error and report if it appears to be an engine serialization bug.

Example fix

null
Defensive patterns

Strategy: try-catch

Validate before calling

null

Type guard

null

Try / catch

if err != nil && strings.Contains(err.Error(), "legacy customization object typedef id") {
	// log full error chain; this is an engine-level serialization issue
	return fmt.Errorf("module customization failed: %w", err)
}

Prevention

When it happens

Trigger: After successfully applying __withConstructor or __withFunction, ResultIDInput(updatedObjectTypeDef) errors because the resulting TypeDef result cannot be encoded into a valid TypeDef ID.

Common situations: A customization produced a malformed or incomplete TypeDef (e.g. from a legacy constructor whose output shape is no longer valid); serialization bugs when TypeDef contains unsupported types.

Related errors


AI-assisted analysis of dagger/dagger@82ba2681db (2026-09-05). Data as JSON: /api/errors/68b9a6d10ee3e355. Report an issue: GitHub.