{"record":{"id":"b604429354da8aea","repo":"dagger/dagger","slug":"failed-to-create-stub-typedef-for-no-sdk-module-q","errorCode":null,"errorMessage":"failed to create stub typedef for no-sdk module %q: %w","messagePattern":"failed to create stub typedef for no-sdk module %q: %w","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/schema/modulesource.go","lineNumber":3999,"sourceCode":"\t\t\tif err := dag.Select(ctx, srcInst, &mod, dagql.Selector{Field: \"asModule\"}); err != nil {\n\t\t\t\treturn inst, fmt.Errorf(\"failed to transform module source into module: %w\", err)\n\t\t\t}\n\n\t\t\tcodegenDeps = codegenDeps.With(core.NewUserMod(mod), core.InstallOpts{})\n\t\t}\n\t}\n\n\treturn codegenDeps.SchemaIntrospectionJSONFileForClient(ctx)\n}\n\n// createStubModule creates an empty module definition (no SDK, no blueprints)\nfunc createStubModule(ctx context.Context, mod *core.Module, dag *dagql.Server) (*core.Module, error) {\n\ttypeDef, err := core.SelectTypeDefWithServer(ctx, dag, dagql.Selector{\n\t\tField: \"withObject\",\n\t\tArgs:  []dagql.NamedInput{{Name: \"name\", Value: dagql.String(mod.OriginalName)}},\n\t})\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to create stub typedef for no-sdk module %q: %w\", mod.NameField, err)\n\t}\n\n\tmod, err = mod.WithObject(ctx, typeDef)\n\tif err != nil {\n\t\treturn nil, fmt.Errorf(\"failed to get module definition for no-sdk module %q: %w\", mod.NameField, err)\n\t}\n\n\treturn mod, nil\n}\nfunc (s *moduleSourceSchema) moduleSourceImplementationScoped(\n\tctx context.Context,\n\tsrc dagql.ObjectResult[*core.ModuleSource],\n\targs struct{},\n) (inst dagql.ObjectResult[*core.ModuleSource], err error) {\n\tsourceDigest, err := src.Self().SourceImplementationDigest(ctx)\n\tif err != nil {\n\t\treturn inst, fmt.Errorf(\"failed to get module source implementation digest: %w\", err)\n\t}","sourceCodeStart":3981,"sourceCodeEnd":4017,"githubUrl":"https://github.com/dagger/dagger/blob/82ba2681dbe30d3547a1dc50ea495900ab5b6047/core/schema/modulesource.go#L3981-L4017","documentation":"For modules without an SDK (no runtime), Dagger creates a stub type definition by selecting the \"withObject\" field on the dagql server (SelectTypeDefWithServer) using the module's original name. If that selection fails, this error wraps it, noting it happened while creating a stub typedef for a no-SDK module.","triggerScenarios":"createStubModule invoked for an SDK-less module; the withObject dagql selection fails — e.g. an invalid module name argument or an error in the schema mutation path.","commonSituations":"Module name characters/length rejected by the schema validation; internal dagql errors during object registration; referencing a module source whose name collides or is malformed.","solutions":["Check the module's (original) name for invalid characters and rename the module if needed","Read the wrapped %w cause for the specific withObject error","Retry after fixing the module source metadata (name) in dagger.json or the source config"],"exampleFix":"// before: invalid name\n// dagger.json: {\"name\": \"My Module!\"}\n// after\n// dagger.json: {\"name\": \"my-module\"}","handlingStrategy":"validation","validationCode":"// validate the module name before loading a no-SDK module\nname := mod.OriginalName\nif name == \"\" || !regexp.MustCompile(`^[a-zA-Z][a-zA-Z0-9_-]*$`).MatchString(name) {\n    return fmt.Errorf(\"invalid module name: %q\", name)\n}","typeGuard":null,"tryCatchPattern":"typeDef, err := core.SelectTypeDefWithServer(ctx, dag, dagql.Selector{Field: \"withObject\", Args: []dagql.NamedInput{{Name: \"name\", Value: dagql.String(mod.OriginalName)}}})\nif err != nil {\n    return nil, fmt.Errorf(\"failed to create stub typedef for no-sdk module %q: %w\", mod.NameField, err)\n}","preventionTips":["Use lowercase kebab-case module names in dagger.json","Avoid spaces/special characters in module names","Validate name uniqueness across dependencies"],"tags":["dagger","modules","typedef","no-sdk"],"backgroundTag":"invalid-module-name","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"}