diff --git a/dagger/compiler/build.go b/dagger/compiler/build.go index f20da154..33056e06 100644 --- a/dagger/compiler/build.go +++ b/dagger/compiler/build.go @@ -57,10 +57,20 @@ func Build(sources map[string]fs.FS, args ...string) (*Value, error) { if len(instances) != 1 { return nil, errors.New("only one package is supported at a time") } + for _, value := range instances { + if value.Err != nil { + return nil, value.Err + } + } v, err := c.Context.BuildInstances(instances) if err != nil { return nil, errors.New(cueerrors.Details(err, &cueerrors.Config{})) } + for _, value := range v { + if value.Err() != nil { + return nil, value.Err() + } + } if len(v) != 1 { return nil, errors.New("internal: wrong number of values") }