HugoBlox / hugo-blox-builder

🚨 GROW YOUR AUDIENCE WITH HUGOBLOX! 🚀 HugoBlox is an easy, fast no-code website builder for researchers, entrepreneurs, data scientists, and developers. Build stunning sites in minutes. 适合研究人员、企业家、数据科学家和开发者的简单快速无代码网站构建器。用拖放功能、可定制模板和内置SEO工具快速创建精美网站!
https://hugoblox.com/templates/
MIT License
8.19k stars 2.9k forks source link

Error calling Concat with "text/x-scss" and "text/css" on Netlify #1613

Closed marpaia closed 4 years ago

marpaia commented 4 years ago

Hey! I am running into a strange issue.. I'm trying to update the version of Academic and Hugo that I use for my site. Locally, I've gotten the full build to work properly with Hugo 0.68.3 and Academic a7dc76f. When I go to do a Netlify deploy, however, I get the following error:

render of "page" failed: execute of template failed: template: talk/single.html:4:3: executing "talk/single.html" at <partial "site_head" .>: error calling partial: "/opt/build/repo/themes/academic/layouts/partials/site_head.html:131:56": execute of template failed: template: partials/site_head.html:131:56: executing "partials/site_head.html" at <resources.Concat>: error calling Concat: resources in Concat must be of the same Media Type, got "text/x-scss" and "text/css"

I'm unfortunately not able to reproduce this error locally. The following is the complete build log with the complete failure. Any advice would be most appreciated!

5:14:29 PM: Build ready to start
5:14:31 PM: build-image version: 8e315e54bc4032a32e73290be556cde4f8348c12
5:14:31 PM: build-image tag: v2.8.2
5:14:31 PM: buildbot version: 45cd00068410d70db72c9672cdd014995488e12a
5:14:31 PM: Fetching cached dependencies
5:14:31 PM: Starting to download cache of 243.6MB
5:14:32 PM: Finished downloading cache in 1.453314471s
5:14:32 PM: Starting to extract cache
5:14:40 PM: Finished extracting cache in 7.844201116s
5:14:40 PM: Finished fetching cache in 9.365515285s
5:14:40 PM: Starting to prepare the repo for build
5:14:41 PM: Preparing Git Reference pull/4/head
5:14:42 PM: Found netlify.toml. Overriding site configuration
5:14:42 PM: Different build command detected, going to use the one specified in the toml file: 'hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL' versus 'hugo --gc --minify' in the site
5:14:42 PM: Starting build script
5:14:42 PM: Installing dependencies
5:14:43 PM: Started restoring cached node version
5:14:46 PM: Finished restoring cached node version
5:14:46 PM: v8.17.0 is already installed.
5:14:47 PM: Now using node v8.17.0 (npm v6.13.4)
5:14:47 PM: Attempting ruby version 2.3.6, read from environment
5:14:48 PM: Using ruby version 2.3.6
5:14:48 PM: Using PHP version 5.6
5:14:48 PM: Installing Hugo 0.68.3
5:14:49 PM: Hugo Static Site Generator v0.68.3-157669A0 linux/amd64 BuildDate: 2020-03-24T12:05:34Z
5:14:49 PM: Started restoring cached go cache
5:14:51 PM: Finished restoring cached go cache
5:14:51 PM: Installing Go version 1.10
5:14:51 PM: unset GOOS;
5:14:51 PM: unset GOARCH;
5:14:51 PM: export GOROOT='/opt/buildhome/.gimme_cache/versions/go1.10.linux.amd64';
5:14:51 PM: export PATH="/opt/buildhome/.gimme_cache/versions/go1.10.linux.amd64/bin:${PATH}";
5:14:51 PM: go version >&2;
5:14:51 PM: export GIMME_ENV='/opt/buildhome/.gimme_cache/env/go1.10.linux.amd64.env';
5:14:51 PM: go version go1.10 linux/amd64
5:14:51 PM: Installing missing commands
5:14:51 PM: Verify run directory
5:14:51 PM: Executing user command: hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL
5:14:51 PM: Building sites …
5:14:51 PM: ERROR 2020/03/26 17:14:51 render of "page" failed: execute of template failed: template: talk/single.html:4:3: executing "talk/single.html" at <partial "site_head" .>: error calling partial: "/opt/build/repo/themes/academic/layouts/partials/site_head.html:131:56": execute of template failed: template: partials/site_head.html:131:56: executing "partials/site_head.html" at <resources.Concat>: error calling Concat: resources in Concat must be of the same Media Type, got "text/x-scss" and "text/css"
5:14:51 PM: ERROR 2020/03/26 17:14:51 render of "page" failed: execute of template failed: template: talk/single.html:4:3: executing "talk/single.html" at <partial "site_head" .>: error calling partial: "/opt/build/repo/themes/academic/layouts/partials/site_head.html:131:56": execute of template failed: template: partials/site_head.html:131:56: executing "partials/site_head.html" at <resources.Concat>: error calling Concat: resources in Concat must be of the same Media Type, got "text/x-scss" and "text/css"
5:14:51 PM: ERROR 2020/03/26 17:14:51 render of "page" failed: execute of template failed: template: talk/single.html:4:3: executing "talk/single.html" at <partial "site_head" .>: error calling partial: "/opt/build/repo/themes/academic/layouts/partials/site_head.html:131:56": execute of template failed: template: partials/site_head.html:131:56: executing "partials/site_head.html" at <resources.Concat>: error calling Concat: resources in Concat must be of the same Media Type, got "text/x-scss" and "text/css"
5:14:51 PM: ERROR 2020/03/26 17:14:51 render of "page" failed: execute of template failed: template: talk/single.html:4:3: executing "talk/single.html" at <partial "site_head" .>: error calling partial: "/opt/build/repo/themes/academic/layouts/partials/site_head.html:131:56": execute of template failed: template: partials/site_head.html:131:56: executing "partials/site_head.html" at <resources.Concat>: error calling Concat: resources in Concat must be of the same Media Type, got "text/x-scss" and "text/css"
5:14:51 PM: ERROR 2020/03/26 17:14:51 failed to render pages: render of "page" failed: execute of template failed: template: publication/single.html:4:3: executing "publication/single.html" at <partial "site_head" .>: error calling partial: "/opt/build/repo/themes/academic/layouts/partials/site_head.html:131:56": execute of template failed: template: partials/site_head.html:131:56: executing "partials/site_head.html" at <resources.Concat>: error calling Concat: resources in Concat must be of the same Media Type, got "text/x-scss" and "text/css"
5:14:51 PM: Total in 359 ms
5:14:51 PM: Error: Error building site: TOCSS: failed to transform "main_parsed.scss" (text/x-scss): resource "scss/scss/main.scss_6c95cc1249b26b124274204dbf970c34" not found in file cache
5:14:51 PM: Skipping functions preparation step: no functions directory set
5:14:51 PM: Caching artifacts
5:14:51 PM: Started saving pip cache
5:14:51 PM: Finished saving pip cache
5:14:51 PM: Started saving emacs cask dependencies
5:14:52 PM: Finished saving emacs cask dependencies
5:14:52 PM: Started saving maven dependencies
5:14:52 PM: Finished saving maven dependencies
5:14:52 PM: Started saving boot dependencies
5:14:52 PM: Finished saving boot dependencies
5:14:52 PM: Started saving go dependencies
5:15:00 PM: Finished saving go dependencies
5:15:00 PM: Error running command: Build script returned non-zero exit code: 255
5:15:00 PM: Failing build: Failed to build site
5:15:00 PM: failed during stage 'building site': Build script returned non-zero exit code: 255
5:15:00 PM: Finished processing build request in 29.265992331s
joshmorel commented 4 years ago

The issue is your hugo version isn't extended: 5:14:49 PM: Hugo Static Site Generator v0.68.3-157669A0 linux/amd64 BuildDate: 2020-03-24T12:05:34Z

Mine is: 3:08:17 PM: Hugo Static Site Generator v0.66.0-78C3C78F/extended linux/amd64 BuildDate: 2020-03-03T15:28:32Z

Looking at netlify docs and my netlify.toml I don't see where this can be set. Maybe netlify decided based on version? Try setting version HUGO_VERSION = 0.66.0?

I am using this exact netlify.toml from recent academic-kickstart commit: https://github.com/sourcethemes/academic-kickstart/blob/3bac8f0494bf35e64fb5943a99ccc377e7cac390/netlify.toml

marpaia commented 4 years ago

Unfortunately 0.66.0 produces the same error (log below). Is there any way to be explicit about forcing an install of an extended version of hugo?

8:28:17 PM: Build ready to start
8:28:20 PM: build-image version: 8e315e54bc4032a32e73290be556cde4f8348c12
8:28:20 PM: build-image tag: v2.8.2
8:28:20 PM: buildbot version: 45cd00068410d70db72c9672cdd014995488e12a
8:28:20 PM: Fetching cached dependencies
8:28:20 PM: Starting to download cache of 243.6MB
8:28:25 PM: Finished downloading cache in 4.721123104s
8:28:25 PM: Starting to extract cache
8:28:32 PM: Finished extracting cache in 7.829062899s
8:28:33 PM: Finished fetching cache in 12.607511539s
8:28:33 PM: Starting to prepare the repo for build
8:28:33 PM: Preparing Git Reference pull/4/head
8:28:35 PM: Found netlify.toml. Overriding site configuration
8:28:35 PM: Different build command detected, going to use the one specified in the toml file: 'hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL' versus 'hugo --gc --minify' in the site
8:28:35 PM: Starting build script
8:28:35 PM: Installing dependencies
8:28:35 PM: Started restoring cached node version
8:28:39 PM: Finished restoring cached node version
8:28:39 PM: v8.17.0 is already installed.
8:28:40 PM: Now using node v8.17.0 (npm v6.13.4)
8:28:40 PM: Attempting ruby version 2.3.6, read from environment
8:28:41 PM: Using ruby version 2.3.6
8:28:41 PM: Using PHP version 5.6
8:28:41 PM: Installing Hugo 0.66.0
8:28:43 PM: Hugo Static Site Generator v0.66.0-78C3C78F linux/amd64 BuildDate: 2020-03-03T15:21:50Z
8:28:43 PM: Started restoring cached go cache
8:28:44 PM: Finished restoring cached go cache
8:28:44 PM: Installing Go version 1.10
8:28:44 PM: unset GOOS;
8:28:44 PM: unset GOARCH;
8:28:44 PM: export GOROOT='/opt/buildhome/.gimme_cache/versions/go1.10.linux.amd64';
8:28:44 PM: export PATH="/opt/buildhome/.gimme_cache/versions/go1.10.linux.amd64/bin:${PATH}";
8:28:44 PM: go version >&2;
8:28:44 PM: export GIMME_ENV='/opt/buildhome/.gimme_cache/env/go1.10.linux.amd64.env';
8:28:45 PM: go version go1.10 linux/amd64
8:28:45 PM: Installing missing commands
8:28:45 PM: Verify run directory
8:28:45 PM: Executing user command: hugo --gc --minify --buildFuture -b $DEPLOY_PRIME_URL
8:28:45 PM: Building sites …
8:28:45 PM: ERROR 2020/03/26 20:28:45 Transformation failed: TOCSS: failed to transform "main_parsed.scss" (text/x-scss): resource "scss/scss/main.scss_6c95cc1249b26b124274204dbf970c34" not found in file cache. Check your Hugo installation; you need the extended version to build SCSS/SASS.
8:28:45 PM: ERROR 2020/03/26 20:28:45 render of "page" failed: execute of template failed: template: talk/single.html:4:3: executing "talk/single.html" at <partial "site_head" .>: error calling partial: "/opt/build/repo/themes/academic/layouts/partials/site_head.html:131:56": execute of template failed: template: partials/site_head.html:131:56: executing "partials/site_head.html" at <resources.Concat>: error calling Concat: resources in Concat must be of the same Media Type, got "text/x-scss" and "text/css"
8:28:45 PM: ERROR 2020/03/26 20:28:45 render of "page" failed: execute of template failed: template: talk/single.html:4:3: executing "talk/single.html" at <partial "site_head" .>: error calling partial: "/opt/build/repo/themes/academic/layouts/partials/site_head.html:131:56": execute of template failed: template: partials/site_head.html:131:56: executing "partials/site_head.html" at <resources.Concat>: error calling Concat: resources in Concat must be of the same Media Type, got "text/x-scss" and "text/css"
8:28:45 PM: ERROR 2020/03/26 20:28:45 render of "page" failed: execute of template failed: template: talk/single.html:4:3: executing "talk/single.html" at <partial "site_head" .>: error calling partial: "/opt/build/repo/themes/academic/layouts/partials/site_head.html:131:56": execute of template failed: template: partials/site_head.html:131:56: executing "partials/site_head.html" at <resources.Concat>: error calling Concat: resources in Concat must be of the same Media Type, got "text/x-scss" and "text/css"
8:28:45 PM: ERROR 2020/03/26 20:28:45 render of "page" failed: execute of template failed: template: talk/single.html:4:3: executing "talk/single.html" at <partial "site_head" .>: error calling partial: "/opt/build/repo/themes/academic/layouts/partials/site_head.html:131:56": execute of template failed: template: partials/site_head.html:131:56: executing "partials/site_head.html" at <resources.Concat>: error calling Concat: resources in Concat must be of the same Media Type, got "text/x-scss" and "text/css"
8:28:45 PM: Total in 383 ms
8:28:45 PM: Error: Error building site: failed to render pages: render of "page" failed: execute of template failed: template: publication/single.html:4:3: executing "publication/single.html" at <partial "site_head" .>: error calling partial: "/opt/build/repo/themes/academic/layouts/partials/site_head.html:131:56": execute of template failed: template: partials/site_head.html:131:56: executing "partials/site_head.html" at <resources.Concat>: error calling Concat: resources in Concat must be of the same Media Type, got "text/x-scss" and "text/css"
8:28:45 PM: Skipping functions preparation step: no functions directory set
8:28:45 PM: Caching artifacts
8:28:45 PM: Started saving pip cache
8:28:45 PM: Finished saving pip cache
8:28:45 PM: Started saving emacs cask dependencies
8:28:45 PM: Finished saving emacs cask dependencies
8:28:45 PM: Started saving maven dependencies
8:28:45 PM: Finished saving maven dependencies
8:28:45 PM: Started saving boot dependencies
8:28:45 PM: Finished saving boot dependencies
8:28:45 PM: Started saving go dependencies
8:28:47 PM: Finished saving go dependencies
8:28:47 PM: Error running command: Build script returned non-zero exit code: 255
8:28:47 PM: Failing build: Failed to build site
8:28:47 PM: failed during stage 'building site': Build script returned non-zero exit code: 255
8:28:47 PM: Finished processing build request in 27.497388515s
marpaia commented 4 years ago

@joshmorel what is your build image?

marpaia commented 4 years ago

It looks like the issue was that I was still on Ubuntu 14.04. Upgrading to 16.04 did the trick!

https://rahilw.dev/blog/hugo-extended-on-netlify/