diff --git a/cue/load/import.go b/cue/load/import.go index 33c09720911..c596e87fa4a 100644 --- a/cue/load/import.go +++ b/cue/load/import.go @@ -250,6 +250,8 @@ func setFileSource(cfg *Config, f *build.File) error { } if !filepath.IsAbs(fullPath) { fullPath = filepath.Join(cfg.Dir, fullPath) + // Ensure that encoding.NewDecoder will work correctly. + f.Filename = fullPath } if fi := cfg.fileSystem.getOverlay(fullPath); fi != nil { if fi.file != nil {