dagger/dagger · error
attach enum typedef source map: %w
Error message
attach enum typedef source map: %w
What it means
EnumTypeDef.AttachDependencyResults got an error back from the attach callback while re-attaching the enum's SourceMap result. The wrap points at dagql dependency hydration failing for the source-map object, not at the enum itself.
Source
Thrown at core/typedef.go:2056
return decodePersistedEnumTypeDef(ctx, dag, &persisted)
}
//nolint:dupl // symmetric with InterfaceTypeDef.AttachDependencyResults; each typedef kind walks its own fields
func (enum *EnumTypeDef) AttachDependencyResults(
ctx context.Context,
_ dagql.AnyResult,
attach func(dagql.AnyResult) (dagql.AnyResult, error),
) ([]dagql.AnyResult, error) {
if enum == nil {
return nil, nil
}
owned := make([]dagql.AnyResult, 0, 1+len(enum.Members))
if enum.SourceMap.Valid && enum.SourceMap.Value.Self() != nil {
attached, err := attach(enum.SourceMap.Value)
if err != nil {
return nil, fmt.Errorf("attach enum typedef source map: %w", err)
}
typed, ok := attached.(dagql.ObjectResult[*SourceMap])
if !ok {
return nil, fmt.Errorf("attach enum typedef source map: unexpected result %T", attached)
}
enum.SourceMap = dagql.NonNull(typed)
owned = append(owned, typed)
}
for i, member := range enum.Members {
if member.Self() == nil {
continue
}
attached, err := attach(member)
if err != nil {
return nil, fmt.Errorf("attach enum typedef member %d: %w", i, err)
}
typed, ok := attached.(dagql.ObjectResult[*EnumMemberTypeDef])
if !ok {View on GitHub (pinned to 82ba2681db)
Solutions
- Inspect the wrapped inner error for the root cause
- Re-sync/rebuild the module so source maps are regenerated
- Clear engine cache and retry the module load
- Update dagger CLI/SDK to matching versions
Defensive patterns
Strategy: try-catch
Validate before calling
if enum.SourceMap.Valid && enum.SourceMap.Value.Self() != nil {
// only then attach
} Try / catch
if err != nil && strings.Contains(err.Error(), "attach enum typedef source map") {
// inspect wrapped cause; retry after re-syncing module / clearing cache
} Prevention
- Keep source-map metadata regenerated via dagger develop
- Match engine/SDK versions
- Clear cache on attach errors
When it happens
Trigger: The enum typedef carries a valid SourceMap whose underlying object cannot be attached to the dagql server (e.g. its dependencies are not resolvable during attach).
Common situations: Engine-side attach pipeline failure while loading a module whose enum carries source-map metadata; missing dependency results for the SourceMap object.
Related errors
- namespace interface source map id: %w
- namespace interface source map: %w
- namespace enum source map id: %w
- namespace enum source map: %w
- namespace enum member source map id: %w
AI-assisted analysis of dagger/dagger@82ba2681db (2026-09-05).
Data as JSON: /api/errors/b78c9921ce05a57a.
Report an issue: GitHub.