{"record":{"id":"4da3ca44e0c2fca3","repo":"dagger/dagger","slug":"failed-to-load-module-from-type-defs-json-w","errorCode":null,"errorMessage":"failed to load module from type defs json: %w","messagePattern":"failed to load module from type defs json: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/sdk/module_typedefs.go","lineNumber":158,"sourceCode":"\t\t\tField: \"contents\",\n\t\t},\n\t)\n\tif err != nil {\n\t\treturn inst, fmt.Errorf(\"failed to get type defs json during module sdk codegen: %w\", err)\n\t}\n\n\tvar modID core.ModuleID\n\tif err = json.Unmarshal([]byte(modDefsID), &modID); err != nil {\n\t\treturn inst, fmt.Errorf(\"failed to decode module ID from type defs json: %w\", err)\n\t}\n\n\tmodCallID, err := modID.ID()\n\tif err != nil {\n\t\treturn inst, fmt.Errorf(\"failed to get module ID handle from type defs json: %w\", err)\n\t}\n\tinst, err = dagql.NewID[*core.Module](modCallID).Load(ctx, dag)\n\tif err != nil {\n\t\treturn inst, fmt.Errorf(\"failed to load module from type defs json: %w\", err)\n\t}\n\tif modCallID.IsHandle() {\n\t\tcache, err := dagql.EngineCache(ctx)\n\t\tif err != nil {\n\t\t\treturn inst, fmt.Errorf(\"failed to get engine cache for sdk moduleTypes dependency: %w\", err)\n\t\t}\n\t\tif err := cache.AddExplicitDependency(ctx, ctr, inst, \"sdk_module_types_generated_module\"); err != nil {\n\t\t\treturn inst, fmt.Errorf(\"failed to retain loaded module result from sdk moduleTypes exec: %w\", err)\n\t\t}\n\t}\n\n\treturn inst, nil\n}\n","sourceCodeStart":140,"sourceCodeEnd":172,"githubUrl":"https://github.com/dagger/dagger/blob/82ba2681dbe30d3547a1dc50ea495900ab5b6047/core/sdk/module_typedefs.go#L140-L172","documentation":"Wraps a failure to load the *core.Module object from the dagql ID derived from the typedefs JSON (dagql.NewID[*core.Module](modCallID).Load). Dagger throws this when the module produced by the SDK's moduleTypes exec cannot be resolved as a Module object in the current DAG session.","triggerScenarios":"The Load of the module ID errors: the referenced module result was computed in an inaccessible scope, the ID's underlying call failed, or session/engine state no longer has the result.","commonSituations":"Dependency module scoping issues (module loaded across scoped sessions); engine restart mid-operation; upstream module call that produced the ID failed.","solutions":["Read the wrapped cause for the underlying module load error.","Retry the operation; check for engine/session restarts in logs.","Verify dependency modules resolve correctly and versions match."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"inst, err := dagql.NewID[*core.Module](modCallID).Load(ctx, dag)\nif err != nil {\n    // check for session/engine restart; retry once\n    return retryLoad(ctx, modCallID)\n}","preventionTips":["Avoid engine restarts during module dependency loads","Keep dependency modules resolvable","Watch for context cancellation in long operations"],"tags":["dagger","dagql","module","load"],"backgroundTag":"id-load-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"}