dagger/dagger · error

unexpected mod dependency type %T

Error message

unexpected mod dependency type %T

What it means

Type-switch default in moduleDependencies: a module dependency's concrete type is neither a loaded module (ModuleResult set) nor *CoreMod (which is skipped). An unknown Mod implementation leaked into the dependency list — the %T shows its Go type. Indicates a new Mod kind that this code path was not updated to handle.

Source

Thrown at core/schema/module.go:2832

	}
}

func (s *moduleSchema) moduleDependencies(
	ctx context.Context,
	mod *core.Module,
	args struct{},
) (dagql.Array[*core.Module], error) {
	depMods := make([]*core.Module, 0, len(mod.Deps.Mods()))
	for _, dep := range mod.Deps.Mods() {
		if depInst := dep.ModuleResult(); depInst.Self() != nil {
			depMods = append(depMods, depInst.Self())
			continue
		}
		switch dep.(type) {
		case *CoreMod:
			// skip
		default:
			return nil, fmt.Errorf("unexpected mod dependency type %T", dep)
		}
	}
	return depMods, nil
}

func (s *moduleSchema) moduleWithDescription(ctx context.Context, mod *core.Module, args struct {
	Description string
}) (*core.Module, error) {
	return mod.WithDescription(args.Description), nil
}

func (s *moduleSchema) moduleWithObject(ctx context.Context, mod *core.Module, args struct {
	Object core.TypeDefID
}) (_ *core.Module, rerr error) {
	dag, err := core.CurrentDagqlServer(ctx)
	if err != nil {
		return nil, fmt.Errorf("failed to get dag server: %w", err)
	}

View on GitHub (pinned to 82ba2681db)

Solutions

  1. Inspect the reported Go type to identify the unexpected Mod implementation
  2. Update moduleDependencies to handle (or explicitly skip) that Mod kind
  3. Ensure module dependencies are loaded before listing them
Defensive patterns

Strategy: type-guard

When it happens

Trigger: Thrown at core/schema/module.go:2832 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of dagger/dagger@82ba2681db (2026-09-05). Data as JSON: /api/errors/63e1d8e82c7f9870. Report an issue: GitHub.