I run my site locally and everthing is going fine without any error.
But when I try to deploy through Vercel with hugo --gc --minify
command, I got the following error message :
Building sites … ERROR 2023/03/29 09:26:41 render of "page" failed: execute of template failed: template: _default/single.html:3:6: executing "_default/single.html" at <partial "head.html" .>: error calling partial: "/vercel/path0/themes/gallery/layouts/partials/head.html:25:41": execute of template failed: template: partials/head.html:25:41: executing "partials/head.html" at <js>: can't evaluate field Build in type string
The partial head.html
is as follows:
<head>
{{ if .IsHome -}}
<title>{{ block "title" . }}{{ .Site.Title }}{{ end }}</title>
{{- else -}}
<title>{{ .Title }} – {{ .Site.Title }}</title>
{{- end }}
<link rel="canonical" href="{{ .Permalink }}">
<link rel="icon" type="image/svg+xml" href="{{ "images/favicon.svg" | relURL }}">
<link rel="icon" type="image/png" href="{{ "images/favicon.png" | relURL }}">
<link rel="apple-touch-icon" sizes="180x180" href="{{ "images/apple-touch-icon.png" | relURL }}">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, viewport-fit=cover">
<meta name="description" content="{{ with .Description }}{{ . }}{{ else }}{{ with .Site.Params.description }}{{ . }}{{ end }}{{ end }}">
{{ hugo.Generator }}
{{ if .Params.private }}
<meta name="robots" content="noindex, nofollow">
{{ end }}
{{ range .AlternativeOutputFormats -}}
{{ printf `<link rel="%s" type="%s" href="%s" title="%s" />` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }}
{{ end -}}
{{ template "_internal/opengraph.html" . }}
{{ $scss := resources.Get "/scss/main.scss" }}
{{ $css := $scss | resources.ToCSS | resources.Minify | resources.Fingerprint }}
<link rel="stylesheet" href="{{ $css.RelPermalink }}">
{{ $js := resources.Get "js/main.js" | js.Build (dict "minify" true) | resources.Fingerprint }}
<script src="{{ $js.RelPermalink }}" defer></script>
</head>
Any idea why the deployment failed ? Any support or directive will be much appreciated.