{"record":{"id":"f783f0baa30cf6da","repo":"dagger/dagger","slug":"s-q-w","errorCode":null,"errorMessage":"%s %q: %w","messagePattern":"(.+?) %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"engine/server/session_workspaces.go","lineNumber":1912,"sourceCode":"}\n\n// moduleLoadFailure is the API-facing record of a skipped module: its name\n// (matching the skipped-module span), its workspace directory (so generate\n// can tell whether the run regenerated it) and the described message.\nfunc moduleLoadFailure(mod pendingModule, err error) core.ModuleLoadFailure {\n\treturn core.ModuleLoadFailure{\n\t\tName:    moduleProgressName(mod),\n\t\tDir:     mod.WorkspaceDir,\n\t\tMessage: core.DescribeLoadFailure(err),\n\t}\n}\n\nfunc moduleLoadErr(load moduleLoadRequest, err error) error {\n\tprefix := \"loading module\"\n\tif load.mod.Kind == moduleLoadKindExtra {\n\t\tprefix = \"loading extra module\"\n\t}\n\treturn fmt.Errorf(\"%s %q: %w\", prefix, load.mod.Ref, err)\n}\n\nfunc entrypointTierPriority(kind moduleLoadKind) int {\n\tswitch kind {\n\tcase moduleLoadKindExtra:\n\t\treturn 3\n\tcase moduleLoadKindAmbient:\n\t\treturn 1\n\tdefault:\n\t\treturn 0\n\t}\n}\n\nfunc shouldPreferEntrypointNomination(\n\tcurrentLoad moduleLoadRequest,\n\tcurrentResolved resolvedModuleLoad,\n\tnextLoad moduleLoadRequest,\n\tnextResolved resolvedModuleLoad,","sourceCodeStart":1894,"sourceCodeEnd":1930,"githubUrl":"https://github.com/dagger/dagger/blob/82ba2681dbe30d3547a1dc50ea495900ab5b6047/engine/server/session_workspaces.go#L1894-L1930","documentation":"moduleLoadErr is the standard wrapper for primary-module load failures: 'loading module \"<ref>\": ...' (or 'loading extra module \"<ref>\": ...' when the request kind is moduleLoadKindExtra). It attaches the requested module ref to whatever error the module install (serveModule) produced, so users see which -m / workspace module failed and why.","triggerScenarios":"Any primary or extra module load (from dagger -m, workspace modules, ambient entrypoints) where serveModule for the primary module fails after related modules were served successfully.","commonSituations":"-m pointing at a module with compile errors or invalid dagger.json; entrypoint constructor failing (though SkipConstructor is used for deps); ref resolving to a module that can't be installed into the session; stale generated code after an SDK upgrade.","solutions":["Read the inner error after the ref to see the actual serveModule failure.","Fix the module source at the given ref: valid dagger.json, compilable code, correct SDK.","Regenerate the module (dagger develop) if generated code is stale.","For extra modules, verify the -m path/ref is correct and accessible."],"exampleFix":"// before\n$ dagger -m ./modules/typo call fn\nerror: loading module \"./modules/typo\": ...\n// after\n$ dagger -m ./modules/my-module call fn  # correct path, valid dagger.json","handlingStrategy":"try-catch","validationCode":"// preflight for -m usage\nif _, err := os.Stat(filepath.Join(modulePath, \"dagger.json\")); err != nil { return fmt.Errorf(\"%s is not a module\", modulePath) }","typeGuard":null,"tryCatchPattern":"// surface both ref and cause: message is already \"loading [extra] module \\\"<ref>\\\": <cause>\"\nif err != nil { if strings.HasPrefix(err.Error(), \"loading \") { log.Fatalf(\"%v\", err) } }","preventionTips":["Verify -m paths/refs point at valid module directories.","Run dagger develop after SDK or code changes before sharing modules.","Read the wrapped cause — it names the exact install failure."],"tags":["modules","cli","loading"],"backgroundTag":"module-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"}