Any ideas why this may be failing on Netlify deploy, but building fine locally?
Netlify build log:
7:24:52 PM: Netlify Build
7:24:52 PM: ────────────────────────────────────────────────────────────────
7:24:52 PM:
7:24:52 PM: ❯ Version
7:24:52 PM: @netlify/build 29.53.0
7:24:52 PM:
7:24:52 PM: ❯ Flags
7:24:52 PM: accountId: 593ef9cea700c425465b0667
7:24:52 PM: baseRelDir: false
7:24:52 PM: buildId: 66c525a74664ad0008c2b642
7:24:52 PM: deployId: 66c525a74664ad0008c2b644
7:24:52 PM:
7:24:52 PM: ❯ Current directory
7:24:52 PM: /opt/build/repo
7:24:52 PM:
7:24:52 PM: ❯ Config file
7:24:52 PM: /opt/build/repo/netlify.toml
7:24:52 PM:
7:24:52 PM: ❯ Context
7:24:52 PM: production
7:24:53 PM:
7:24:53 PM: ❯ Loading plugins
7:24:53 PM: - @netlify/plugin-lighthouse@6.0.0 from Netlify app
7:24:55 PM: Failed during stage 'building site': Build script returned non-zero exit code: 2
7:24:54 PM:
7:24:54 PM: build.command from netlify.toml
7:24:54 PM: ────────────────────────────────────────────────────────────────
7:24:54 PM:
7:24:54 PM: $ curl -LJO https://github.com/sass/dart-sass/releases/download/1.77.8/dart-sass-1.77.8-linux-x64.tar.gz && tar -xf dart-sass-1.77.8-linux-x64.tar.gz && rm dart-sass-1.77.8-linux-x64.tar.gz && export PATH=/opt/build/repo/dart-sass:$PATH && hugo --gc --minify
7:24:54 PM: % Total % Received % Xferd Average Speed Time Time Time Current
7:24:54 PM: Dload Upload Total Spent Left Speed
7:24:54 PM: 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
7:24:54 PM: 0 0 0 0 0 0 0 0 --:--:-- --:--:-- --:--:-- 0
7:24:55 PM: 100 3673k 100 3673k 0 0 12.1M 0 --:--:-- --:--:-- --:--:-- 12.1M
7:24:55 PM: curl: Saved to filename 'dart-sass-1.77.8-linux-x64.tar.gz'
7:24:55 PM: Start building sites …
7:24:55 PM: hugo v0.133.0-c9777473d1369f812d727a6c07dc57ad7be7bf62+extended linux/amd64 BuildDate=2024-08-17T19:57:41Z VendorInfo=gohugoio
7:24:55 PM: Total in 164 ms
7:24:55 PM: Error: error building site: process: readAndProcessContent: "/opt/build/repo/content/library/ratings/tv/_content.gotmpl:20:32": template: /opt/build/repo/content/library/ratings/tv/_content.gotmpl:20:32: executing "/opt/build/repo/content/library/ratings/tv/_content.gotmpl" at <time.AsTime>: error calling AsTime: unable to parse date: 1 Jan 1970
7:24:55 PM:
7:24:55 PM: "build.command" failed
Here is the offending line, according to the above log (with accompanying previous line):
{{ $t := time (.year | int) }}
{{ $dates := dict "date" (time.AsTime (time.Format "2 Jan 2006" $t)) }}
Here is the portion of the JSON that the content adapter is referring to:
...
"year": 2006,
...