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
- Check what the legacy customization mutates on the object TypeDef and ensure the resulting TypeDef is well-formed (valid field types, resolvable functions).
- Regenerate module codegen so the legacy customization produces a current, encodable TypeDef.
- Upgrade the Dagger CLI/engine; older TypeDef shapes may fail ID encoding in newer engines.
- 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
- Keep generated code current with the engine version
- Report persistent occurrences as engine bugs with the full wrapped chain
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
- workspace default optional arg %q type id: %w
- workspace default object typedef id: %w
- encode directory module source %q context ID: %w
- failed to generate return type code: %w
- failed to generate arg type code: %w
AI-assisted analysis of dagger/dagger@82ba2681db (2026-09-05).
Data as JSON: /api/errors/68b9a6d10ee3e355.
Report an issue: GitHub.