For context, under 0.4.8 I typically built my personal blog with the following flags:
hugo --verbose --templateMetrics --templateMetricsHints --minify --theme=casper
The --minify flag seems to consistently cause a failure that does not happen without it (see examples below). I iterated through combinations of all flags to confirm the --minify was problematic. No other flag triggers an error unless --minify is enabled.
Interestingly, the exact point of failure with --minify enabled varies with each run. The following examples were done without any changes to the underlying content:
$ hugo --minify --theme=casper
Building sites … ERROR 2018/11/05 14:34:00 parse error:9:16: unexpected comma character outside an array or object
9: "@type": "Article",
^
ERROR 2018/11/05 14:34:00 parse error:3:88: unexpected comma character outside an array or object
3: <link rel="canonical" href="https://maisonbisson.com/post/in-the-window-at-bobs-donuts/" />
^
ERROR 2018/11/05 14:34:00 parse error:7:11: unexpected comma character outside an array or object
7: "sameAs": [
^
ERROR 2018/11/05 14:34:00 parse error:5:15: unexpected comma character outside an array or object
5: <link rel="apple-touch-icon" sizes="167x167" href="/images/touch-icon-ipad-pro.png">
^
Total in 15828 ms
Error: Error building site: failed to render pages: parse error:8:23: unexpected comma character outside an array or object
8: "@context": "https://schema.org",
^
and…
$ hugo --minify --theme=casper
Building sites … ERROR 2018/11/05 14:35:46 parse error:9:16: unexpected comma character outside an array or object
9: "@type": "Article",
^
ERROR 2018/11/05 14:35:46 parse error:5:51: unexpected comma character outside an array or object
5: <meta property="article:tag" content="Olympus OM10" />
^
ERROR 2018/11/05 14:35:46 parse error:8:8: unexpected comma character outside an array or object
8: "@type": "ImageObject",
^
ERROR 2018/11/05 14:35:46 parse error:6:14: unexpected comma character outside an array or object
6: "logo": https://maisonbisson.com/images/icon.png
^
Total in 14098 ms
Error: Error building site: failed to render pages: parse error:5:25: unexpected comma character outside an array or object
5: <meta property="article:tag" content="olympus c8080" />
^
and…
$ hugo --minify --theme=casper
Building sites … ERROR 2018/11/05 14:36:08 parse error:8:28: unexpected comma character outside an array or object
8: "@context": "https://schema.org",
^
ERROR 2018/11/05 14:36:08 parse error:6:10: unexpected comma character outside an array or object
6: "author": {
^
ERROR 2018/11/05 14:36:08 parse error:7:46: unexpected comma character outside an array or object
7: <link rel="canonical" href="https://maisonbisson.com/post/twin-beech-beatty-nv/" />
^
ERROR 2018/11/05 14:36:08 parse error:10:38: unexpected comma character outside an array or object
10: <link href="/index.xml" rel="alternate" type="application/rss+xml" title="MaisonBisson" />
^
Total in 14197 ms
Error: Error building site: failed to render pages: parse error:8:20: unexpected comma character outside an array or object
8: "@context": "https://schema.org",
^
and…
$ hugo --minify --theme=casper
Building sites … ERROR 2018/11/05 14:33:40 parse error:3:94: unexpected comma character outside an array or object
3: <link rel="canonical" href="https://maisonbisson.com/post/willie-christiana-copenhagen/" />
^
ERROR 2018/11/05 14:33:40 parse error:1:134: unexpected comma character outside an array or object
1: 623 C532.057,25.479 533.004,25.448 541,25.448 C548.997,25.448 549.943,25.479 553.102,25.623 C556.021,25.756 557.607,26.244 558.662,26.654 C560.06,27.196 561.058,27.846 562.106,28.894 C563.154,29.942 563.803,30.938 564.346,32.338 C564.756,33.391 565.244,34.978 565.378,37.899 C565.522,41.056 565.552,42.003 565.552,50 C565.552,57.996 565.522,58.943 565.378,62.101 M570.82,37.631 C570.674,34.438 570.167,32.258 569.425,30.349 C568.659,28.377 567.633,26.702 565.965,25.035 C564.297,23.368 562.623,22.342 560.652,21.575 C558.743,20.834 556.562,20.326 553.369,20.18 C550.169,20.033 549.148,20 541,20 C532.853,20 531.831,20.033 528.631,20.18 C525.438,20.326 523.257,20.834 521.349,21.575 C519.376,22.342 517.703,23.368 516.035,25.035 C514.368,26.702 513.342,28.377 512.574,30.349 C511.834,32.258 511.326,34.438 511.181,37.631 C511.035,40.831 511,41.851 511,50 C511,58.147 511.035,59.17 511.181,62.369 C511.326,65.562 511.834,67.743 512.574,69.651 C513.342,71.625 514.368,73.296 516.035,74.965 C517.703,76.634 519.376,77.658 521.349,78.425 C523.257,79.167 525.438,79.673 528.631,79.82 C531.831,79.965 532.853,80.001 541,80.001 C549.148,80.001 550.169,79.965 553.369,79.82 C556.562,79.673 558.743,79.167 560.652,78.425 C562.623,77.658 564.297,76.634 565.965,74.965 C567.633,73.296 568.659,71.625 569.425,69.651 C570.167,67.
^
ERROR 2018/11/05 14:33:40 parse error:9:18: unexpected comma character outside an array or object
9: "@type": "Article",
^
ERROR 2018/11/05 14:33:40 parse error:7:46: unexpected comma character outside an array or object
7: <link rel="canonical" href="https://maisonbisson.com/post/twin-beech-beatty-nv/" />
^
Total in 16566 ms
Error: Error building site: failed to render pages: parse error:7:4: unexpected comma character outside an array or object
7:
^
Here’s a successful run, just for more context:
$ hugo --theme=casper
| EN
+------------------+-------+
Pages | 28957
Paginator pages | 1772
Non-page files | 2669
Static files | 45
Processed images | 2065
Aliases | 14508
Sitemaps | 1
Cleaned | 0
Total in 22739 ms