diff --git a/resources/resource_transformers/js/build.go b/resources/resource_transformers/js/build.go index 0d70bdc337f..ee60aa502ec 100644 --- a/resources/resource_transformers/js/build.go +++ b/resources/resource_transformers/js/build.go @@ -14,7 +14,6 @@ package js import ( - "errors" "fmt" "io/ioutil" "os" @@ -22,6 +21,8 @@ import ( "regexp" "strings" + "github.com/pkg/errors" + "github.com/spf13/afero" "github.com/gohugoio/hugo/hugofs" @@ -108,6 +109,9 @@ func (t *buildTransformation) Transform(ctx *resources.ResourceTransformationCtx createErr := func(msg api.Message) error { loc := msg.Location + if loc == nil { + return errors.New(msg.Text) + } path := loc.File var (