Hugo 0.43 fails to deploy on Netlify


#1

Hi.

Hugo 0.43 fails to deploy on Netlify. The reason:

ERROR 2018/07/11 04:51:52 error: failed to transform resource: failed to transform "scss/styles.scss" (text/x-scss): this feature is not available in your current Hugo version

My config file:

[context.production.environment]
  HUGO_VERSION = "0.43"

My styles injection (taken from example repo):

{{ if .Site.IsServer }}
{{ $cssOpts := (dict "targetPath" "styles.css" "enableSourceMap" true ) }}
{{ $styles := resources.Get "scss/styles.scss" | toCSS $cssOpts }}
<link rel="stylesheet" href="{{ $styles.Permalink }}">
{{ else }}
{{ $cssOpts := (dict "targetPath" "styles.css" ) }}
{{ $styles := resources.Get "scss/styles.scss" | toCSS $cssOpts | minify | fingerprint }}
<link rel="stylesheet" href="{{ $styles.Permalink }}" integrity="{{ $styles.Data.Integrity }}">
{{ end }}

Do you know any solution about it. Is there a way for using extended version of Hugo on Netlify?

Thanks in advance


#2

Not a real solution, but Bep mentioned starting here in the release thread how you can use the Hugo extended version locally and deploy to Netlify using Hugo’s normal version.


#3

I will consider what to do with the CI/Netlify binary situation (make the current Linux extended version (make it static maybe?) and the defaut one, perhaps? Not sure.), but it’s only been 2 days since the relase, and I have other things on my plate.

For me, the preferred workflow is to develop locally and commit the generated content below /resources. That works fine on Netlify with SCSS and PostCSS without Netlify having to know anything about it.


#4

I don’t use SCSS, but still trying to understand this… Is that error because of missing dynamically linked libraries? If so, can we request Netlify to install those libs on their server? Or can some command be run to first install those libraries on Netlify before running Hugo? (The Netlify build command does not need to be just hugo… it can be anything… a wrapper script that calls hugo).

Trying to build statically linked Linux binaries sounds like a huge bloat.


#5

I think it is 2 questions:

  1. The variant they install by default (when setting HUGO_VERSION) is the “regular one”
  2. To run the extended one they need a compatible glibc – which I assume they already have, or should be able to provide without too much trouble.

That said, I assume that Netlify are talking about this themselves and will eventualy come up with a good solution. This will be AOK if you just hang in there for a few days.