{"record":{"id":"9322de57b3a54115","repo":"dagger/dagger","slug":"namespace-enum-typedef-w","errorCode":null,"errorMessage":"namespace enum typedef: %w","messagePattern":"namespace enum typedef: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/module.go","lineNumber":1919,"sourceCode":"\t\t\t\t\tArgs:  []dagql.NamedInput{{Name: \"member\", Value: memberID}},\n\t\t\t\t}); err != nil {\n\t\t\t\t\treturn typeDef, fmt.Errorf(\"namespace enum member: %w\", err)\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\tif sameAttachedResult(updatedEnum, enum) {\n\t\t\treturn typeDef, nil\n\t\t}\n\t\tupdatedEnumID, err := ResultIDInput(updatedEnum)\n\t\tif err != nil {\n\t\t\treturn typeDef, fmt.Errorf(\"namespace enum typedef id: %w\", err)\n\t\t}\n\t\tupdated := typeDef\n\t\tif err := dag.Select(ctx, updated, &updated, dagql.Selector{\n\t\t\tField: \"__withEnumTypeDef\",\n\t\t\tArgs:  []dagql.NamedInput{{Name: \"enumTypeDef\", Value: updatedEnumID}},\n\t\t}); err != nil {\n\t\t\treturn typeDef, fmt.Errorf(\"namespace enum typedef: %w\", err)\n\t\t}\n\t\treturn updated, nil\n\tdefault:\n\t\treturn typeDef, nil\n\t}\n}\n\nfunc (mod *Module) namespaceSourceMap(\n\tctx context.Context,\n\tmodPath string,\n\tsourceMap dagql.Nullable[dagql.ObjectResult[*SourceMap]],\n) (dagql.Nullable[dagql.ObjectResult[*SourceMap]], error) {\n\tif !sourceMap.Valid || sourceMap.Value.Self() == nil {\n\t\t// Even if the SDK didn't provide a source map, record the module\n\t\t// name so downstream consumers (CLI, shell, codegen dependency\n\t\t// filtering) can identify which module a type/function belongs to.\n\t\t// Route through dag.Select rather than NewObjectResultForCurrentCall\n\t\t// so the result is attached and callers can read its ID when calling","sourceCodeStart":1901,"sourceCodeEnd":1937,"githubUrl":"https://github.com/dagger/dagger/blob/82ba2681dbe30d3547a1dc50ea495900ab5b6047/core/module.go#L1901-L1937","documentation":"Final step of enum namespacing: Dagger replaces the enum typedef in the enclosing TypeDef by selecting __withEnumTypeDef with the updated enum's ID. A failing Select is wrapped as 'namespace enum typedef', meaning the dependency enum could not be re-embedded into the typedef after namespacing.","triggerScenarios":"updatedEnumID was produced successfully, but dag.Select(ctx, updated, &updated, Field: __withEnumTypeDef) fails (dagql resolver error on the internal field, engine failure, context cancellation).","commonSituations":"Any cross-module enum usage during codegen or function serving where the internal __withEnumTypeDef mutation fails; engine bugs or version skew; timeouts while loading deep dependency graphs.","solutions":["Inspect the wrapped inner error for the underlying dagql failure.","Update the Dagger engine and CLI and regenerate codegen (dagger develop).","Verify the dependency module is loadable and its published version matches what is referenced.","Retry after transient errors; escalate with a repro if persistent."],"exampleFix":null,"handlingStrategy":"try-catch","validationCode":null,"typeGuard":null,"tryCatchPattern":"_, err := moduleSource.AsModule().GeneratedCode().Directory('.').Entries(ctx)\nif err != nil {\n    if strings.Contains(err.Error(), 'namespace enum typedef') { /* regenerate and retry */ }\n    return err\n}","preventionTips":["Keep dependencies loadable and pinned","Match CLI and engine versions","Regenerate codegen regularly","Retry transient failures"],"tags":["dagger","dagql","enum","typedef"],"backgroundTag":"dagql-select-failed","analyzedSha":"82ba2681dbe30d3547a1dc50ea495900ab5b6047","analyzedAt":"2026-09-05T07:21:37.930Z","contentChangedAt":"2026-09-05T07:21:37.930Z","schemaVersion":2},"datasetVersion":"2026-09-12T12:17:11.808Z"}